fix: revert using portal for ellipsis menu

This commit is contained in:
Antonella Sgarlatta
2021-05-20 15:29:19 -03:00
parent fb12b26a60
commit 0b2665a01b

View File

@@ -56,31 +56,27 @@ export const NotesOptionsPanel = observer(({ appState }: Props) => {
<VisuallyHidden>Actions</VisuallyHidden> <VisuallyHidden>Actions</VisuallyHidden>
<Icon type="more" className="block" /> <Icon type="more" className="block" />
</DisclosureButton> </DisclosureButton>
<Portal> <DisclosurePanel
<div className="sn-component"> onKeyUp={(event) => {
<DisclosurePanel if (event.key === 'Escape' && !submenuOpen) {
onKeyUp={(event) => { setOpen(false);
if (event.key === 'Escape' && !submenuOpen) { buttonRef.current.focus();
setOpen(false); }
buttonRef.current.focus(); }}
} ref={panelRef}
}} style={{
ref={panelRef} ...position,
style={{ }}
...position, className="sn-dropdown flex flex-col py-2"
}} >
className="sn-dropdown flex flex-col py-2" {open && (
> <NotesOptions
{open && ( appState={appState}
<NotesOptions closeOnBlur={closeOnBlur}
appState={appState} onSubmenuChange={onSubmenuChange}
closeOnBlur={closeOnBlur} />
onSubmenuChange={onSubmenuChange} )}
/> </DisclosurePanel>
)}
</DisclosurePanel>
</div>
</Portal>
</Disclosure> </Disclosure>
); );
}); });