import { keyboardKey, SpacebarKey } from '@fluentui/keyboard-key'; import { IS_FOCUSABLE_ATTRIBUTE } from '../../attributes'; import { Accessibility } from '../../types'; /** * @specification * Adds attribute 'tabIndex=0' to 'root' slot. * Triggers 'performClick' action with 'Enter' or 'Spacebar' on 'root'. */ export const attachmentBehavior: Accessibility = () => ({ attributes: { root: { tabIndex: 0, [IS_FOCUSABLE_ATTRIBUTE]: true, }, }, keyActions: { root: { performClick: { keyCombinations: [{ keyCode: keyboardKey.Enter }, { keyCode: SpacebarKey }], }, }, }, }); export type AttachmentBehaviorProps = never;