forked from Mirrors/gomuks
web/autocomplete: scroll selected item into view
This commit is contained in:
parent
8ddf5f800d
commit
716f8b9834
1 changed files with 1 additions and 0 deletions
|
@ -52,6 +52,7 @@ export const EmojiAutocompleter = ({ params, state, setState, setAutocomplete }:
|
|||
endPos: params.startPos + emoji.u.length,
|
||||
frozenQuery: params.frozenQuery ?? params.query,
|
||||
})
|
||||
document.querySelector(`div.autocompletion-item[data-index='${index}']`)?.scrollIntoView({ block: "nearest" })
|
||||
})
|
||||
const onClick = useEvent((evt: React.MouseEvent<HTMLDivElement>) => {
|
||||
const idx = evt.currentTarget.getAttribute("data-index")
|
||||
|
|
Loading…
Add table
Reference in a new issue