Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Render MenuList in a Portal instead of using isolation on the table
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Aug 10, 2021
1 parent 1916498 commit b16b5fa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/EventsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const EventsPanel: React.FC = () => {
</Box>
</Box>
<Box overflowY="auto">
<Table width="100%" isolation="isolate">
<Table width="100%">
<Thead>
<Tr>
<Th {...stickyProps} width="100%">
Expand Down
35 changes: 19 additions & 16 deletions src/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ModalHeader,
ModalOverlay,
Text,
Portal,
} from '@chakra-ui/react';
import { useActor } from '@xstate/react';
import React from 'react';
Expand Down Expand Up @@ -55,25 +56,27 @@ export const Login: React.FC = () => {
width="30px"
/>
</MenuButton>
<MenuList>
{state.context.loggedInUserData && (
<Portal>
<MenuList>
{state.context.loggedInUserData && (
<MenuItem
as="a"
href={registryLinks.viewUserById(
state.context.loggedInUserData.id,
)}
>
View Machines
</MenuItem>
)}
<MenuItem
as="a"
href={registryLinks.viewUserById(
state.context.loggedInUserData.id,
)}
onClick={() => {
authService.send('SIGN_OUT');
}}
>
View Machines
Logout
</MenuItem>
)}
<MenuItem
onClick={() => {
authService.send('SIGN_OUT');
}}
>
Logout
</MenuItem>
</MenuList>
</MenuList>
</Portal>
</Menu>
)}

Expand Down

0 comments on commit b16b5fa

Please sign in to comment.