✨(frontend) re-focus toolbar on shortcut when already open
allow keyboard shortcut to return focus to the emoji toolbar without closing it
This commit is contained in:
@@ -49,7 +49,15 @@ export const ReactionsToggle = () => {
|
||||
|
||||
useRegisterKeyboardShortcut({
|
||||
id: 'reaction',
|
||||
handler: () => setIsOpen((prev) => !prev),
|
||||
handler: () => {
|
||||
if (isOpen) {
|
||||
document
|
||||
.querySelector<HTMLElement>('[role="toolbar"] button')
|
||||
?.focus()
|
||||
} else {
|
||||
setIsOpen(true)
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
const sendReaction = async (emoji: string) => {
|
||||
|
||||
Reference in New Issue
Block a user