mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 13:21:37 +01:00
[Accessibility] Composer: Toggle Attach Menu with keyboard (#1783)
This commit is contained in:
parent
b2ad6a0ae4
commit
395786e0f9
@ -35,6 +35,14 @@ const AttachMenu: FC<OwnProps> = ({
|
||||
}
|
||||
}, [isAttachMenuOpen, markMouseInside]);
|
||||
|
||||
const handleToggleAttachMenu = useCallback(() => {
|
||||
if (isAttachMenuOpen) {
|
||||
closeAttachMenu();
|
||||
} else {
|
||||
openAttachMenu();
|
||||
}
|
||||
}, [isAttachMenuOpen, openAttachMenu, closeAttachMenu]);
|
||||
|
||||
const handleFileSelect = useCallback((e: Event, isQuick: boolean) => {
|
||||
const { files } = e.target as HTMLInputElement;
|
||||
|
||||
@ -67,7 +75,7 @@ const AttachMenu: FC<OwnProps> = ({
|
||||
className={isAttachMenuOpen ? 'AttachMenu--button activated' : 'AttachMenu--button'}
|
||||
round
|
||||
color="translucent"
|
||||
onActivate={openAttachMenu}
|
||||
onActivate={handleToggleAttachMenu}
|
||||
ariaLabel="Add an attachment"
|
||||
ariaControls="attach-menu-controls"
|
||||
hasPopup
|
||||
|
Loading…
x
Reference in New Issue
Block a user