feat: Composer keyboard navigability (#31510)
Co-authored-by: Guilherme Gazzo <guilhermegazzo@gmail.com>pull/31492/head^2
parent
6e0f3c13f6
commit
4c2771fd0c
@ -0,0 +1,8 @@ |
||||
--- |
||||
'@rocket.chat/ui-composer': minor |
||||
'@rocket.chat/meteor': minor |
||||
--- |
||||
|
||||
Composer keyboard navigability |
||||
|
||||
 |
||||
@ -1,8 +1,16 @@ |
||||
import { useToolbar } from '@react-aria/toolbar'; |
||||
import { ButtonGroup } from '@rocket.chat/fuselage'; |
||||
import type { ComponentProps, ReactElement } from 'react'; |
||||
import { useRef, type ComponentProps, type ReactElement } from 'react'; |
||||
|
||||
const MessageComposerToolbarActions = (props: ComponentProps<typeof ButtonGroup>): ReactElement => ( |
||||
<ButtonGroup role='toolbar' small {...props} /> |
||||
); |
||||
const MessageComposerToolbarActions = (props: ComponentProps<typeof ButtonGroup>): ReactElement => { |
||||
const ref = useRef(null); |
||||
const { toolbarProps } = useToolbar(props, ref); |
||||
|
||||
return ( |
||||
<ButtonGroup role='toolbar' small ref={ref} {...toolbarProps}> |
||||
{props.children} |
||||
</ButtonGroup> |
||||
); |
||||
}; |
||||
|
||||
export default MessageComposerToolbarActions; |
||||
|
||||
Loading…
Reference in new issue