fix: keyboard nav when mouse hovered over list (#9500)
This commit is contained in:
@@ -58,6 +58,8 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|||||||
|
|
||||||
const searchProps = () => (typeof props.search === "object" ? props.search : {})
|
const searchProps = () => (typeof props.search === "object" ? props.search : {})
|
||||||
|
|
||||||
|
const moved = (event: MouseEvent) => event.movementX !== 0 || event.movementY !== 0
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
if (props.filter !== undefined) {
|
if (props.filter !== undefined) {
|
||||||
onInput(props.filter)
|
onInput(props.filter)
|
||||||
@@ -227,7 +229,8 @@ export function List<T>(props: ListProps<T> & { ref?: (ref: ListRef) => void })
|
|||||||
data-selected={item === props.current}
|
data-selected={item === props.current}
|
||||||
onClick={() => handleSelect(item, i())}
|
onClick={() => handleSelect(item, i())}
|
||||||
type="button"
|
type="button"
|
||||||
onMouseMove={() => {
|
onMouseMove={(event) => {
|
||||||
|
if (!moved(event)) return
|
||||||
setStore("mouseActive", true)
|
setStore("mouseActive", true)
|
||||||
setActive(props.key(item))
|
setActive(props.key(item))
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user