Skip to content

Commit

Permalink
fix: revert using portal for ellipsis menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed May 20, 2021
1 parent fb12b26 commit 0b2665a
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions app/assets/javascripts/components/NotesOptionsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,27 @@ export const NotesOptionsPanel = observer(({ appState }: Props) => {
<VisuallyHidden>Actions</VisuallyHidden>
<Icon type="more" className="block" />
</DisclosureButton>
<Portal>
<div className="sn-component">
<DisclosurePanel
onKeyUp={(event) => {
if (event.key === 'Escape' && !submenuOpen) {
setOpen(false);
buttonRef.current.focus();
}
}}
ref={panelRef}
style={{
...position,
}}
className="sn-dropdown flex flex-col py-2"
>
{open && (
<NotesOptions
appState={appState}
closeOnBlur={closeOnBlur}
onSubmenuChange={onSubmenuChange}
/>
)}
</DisclosurePanel>
</div>
</Portal>
<DisclosurePanel
onKeyUp={(event) => {
if (event.key === 'Escape' && !submenuOpen) {
setOpen(false);
buttonRef.current.focus();
}
}}
ref={panelRef}
style={{
...position,
}}
className="sn-dropdown flex flex-col py-2"
>
{open && (
<NotesOptions
appState={appState}
closeOnBlur={closeOnBlur}
onSubmenuChange={onSubmenuChange}
/>
)}
</DisclosurePanel>
</Disclosure>
);
});
Expand Down

0 comments on commit 0b2665a

Please sign in to comment.