fix: fix dropdown buttons z-index (#1431)

Closes #1430, Closes #1422
This commit is contained in:
Thaïs
2023-09-04 16:51:12 +02:00
committed by GitHub
parent 96a0f30e98
commit 8e22ffd021
7 changed files with 40 additions and 22 deletions

View File

@ -1,6 +1,5 @@
import { useEffect, useRef } from 'react';
import { Keys } from 'react-hotkeys-hook';
import styled from '@emotion/styled';
import { flip, offset, Placement, useFloating } from '@floating-ui/react';
import { HotkeyScope } from '@/ui/utilities/hotkey/types/HotkeyScope';
@ -13,11 +12,6 @@ import { useDropdownButton } from '../hooks/useDropdownButton';
import { dropdownButtonCustomHotkeyScopeScopedFamilyState } from '../states/dropdownButtonCustomHotkeyScopeScopedFamilyState';
import { DropdownRecoilScopeContext } from '../states/recoil-scope-contexts/DropdownRecoilScopeContext';
const StyledContainer = styled.div`
position: relative;
z-index: 100;
`;
type OwnProps = {
buttonComponents: JSX.Element | JSX.Element[];
dropdownComponents: JSX.Element | JSX.Element[];
@ -81,7 +75,7 @@ export function DropdownButton({
]);
return (
<StyledContainer ref={containerRef}>
<div ref={containerRef}>
{hotkey && (
<HotkeyEffect
hotkey={hotkey}
@ -94,6 +88,6 @@ export function DropdownButton({
{dropdownComponents}
</div>
)}
</StyledContainer>
</div>
);
}