Skip to content

Commit

Permalink
fix(react-keytips): reported issues after bug bash vol 2 (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev authored Mar 11, 2025
1 parent 98d5e8f commit c37b3e9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: reported issues after bug bash",
"packageName": "@fluentui-contrib/react-keytips",
"email": "[email protected]",
"dependentChangeType": "patch"
}
30 changes: 16 additions & 14 deletions packages/react-keytips/src/components/Keytips/renderKeytips.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,22 @@ export const renderKeytips_unstable = (state: KeytipsState) => {
const classes = useStyles();

return (
<Portal
mountNode={{
className: classes.portal,
...state.mountNode,
}}
>
<span
id={KTP_ROOT_ID}
style={VISUALLY_HIDDEN_STYLES}
data-start-shortcut={state.content}
<div id="keytips-container" aria-hidden="true">
<Portal
mountNode={{
className: classes.portal,
...state.mountNode,
}}
>
{state.content}
</span>
{state.keytips.length > 0 && <state.root>{state.keytips}</state.root>}
</Portal>
<span
id={KTP_ROOT_ID}
style={VISUALLY_HIDDEN_STYLES}
data-start-shortcut={state.content}
>
{state.content}
</span>
{state.keytips.length > 0 && <state.root>{state.keytips}</state.root>}
</Portal>
</div>
);
};
4 changes: 2 additions & 2 deletions packages/react-keytips/src/hooks/useHotkeys/useHotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export const useHotkeys = (
}
};

doc?.addEventListener(invokeEvent, handleInvokeEvent);
doc?.addEventListener(invokeEvent, handleInvokeEvent, true);
doc?.addEventListener('keyup', handleKeyUp);
return () => {
doc?.removeEventListener(invokeEvent, handleInvokeEvent);
doc?.removeEventListener(invokeEvent, handleInvokeEvent, true);
doc?.removeEventListener('keyup', handleKeyUp);
clearDelayTimeout();
};
Expand Down
1 change: 0 additions & 1 deletion packages/react-keytips/stories/Overflow/OverflowMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const OverflowMenu = ({
ref={mergedRefs}
icon={<MoreHorizontalRegular />}
aria-label={`${overflowCount} more tabs`}
role="tab"
/>
</MenuTrigger>
<MenuPopover>
Expand Down

0 comments on commit c37b3e9

Please sign in to comment.