Skip to content

Commit ccefc1d

Browse files
committed
Remove scroll wheel navigation from PromptTypeDropdown
1 parent fb02928 commit ccefc1d

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

‎packages/ui/src/components/editor/panel/PromptTypeDropdown/PromptTypeDropdown.tsx‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,6 @@ export const PromptTypeDropdown = <T extends string>(
4646
set_just_opened(false)
4747
}
4848

49-
const handle_wheel = (event: React.WheelEvent<HTMLDivElement>) => {
50-
event.preventDefault()
51-
event.stopPropagation()
52-
53-
const current_index = props.options.findIndex(
54-
(option) => option.value === props.selected_value
55-
)
56-
if (current_index == -1) {
57-
return
58-
}
59-
60-
const options_count = props.options.length
61-
if (options_count <= 1) return
62-
63-
let next_index
64-
if (event.deltaY < 0) {
65-
next_index = (current_index - 1 + options_count) % options_count
66-
} else {
67-
next_index = (current_index + 1) % options_count
68-
}
69-
props.on_change(props.options[next_index].value)
70-
}
71-
7249
const handle_mouse_leave = () => {
7350
opened_by_shortcut.current = false
7451
set_is_open(false)
@@ -133,7 +110,6 @@ export const PromptTypeDropdown = <T extends string>(
133110
<div
134111
className={cn(styles.container, { [styles['button--open']]: is_open })}
135112
ref={container_ref}
136-
onWheel={handle_wheel}
137113
onMouseLeave={handle_mouse_leave}
138114
>
139115
<button

0 commit comments

Comments
 (0)