Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] toolbox menu behind thread component #25925

Merged
merged 7 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export const MessageActionMenu: FC<{
[key: string]: MessageActionConfigOption[];
};

const messagesContainer = document.querySelector('.messages-container') || document.body;

return (
<MessageToolboxItem
ref={ref}
Expand All @@ -38,7 +40,7 @@ export const MessageActionMenu: FC<{
data-qa-type='message-action-menu'
>
{visible && (
<ToolboxDropdown reference={ref} {...rest}>
<ToolboxDropdown reference={ref} container={messagesContainer} {...rest}>
{Object.entries(groupOptions).map(([, options], index, arr) => (
<Fragment key={index}>
{options.map((option) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ const style = css`
`;
export const ToolboxDropdown = <R extends HTMLElement>({
reference,
container,
children,
...rest
}: {
reference: React.RefObject<R>;
container: Element;
children: ReactNode;
}): ReactElement => {
const { isMobile } = useLayout();
Expand All @@ -27,7 +29,7 @@ export const ToolboxDropdown = <R extends HTMLElement>({
return (
<>
<Box className={style} position='fixed' />
<DropdownTemplate ref={target} reference={reference} {...rest}>
<DropdownTemplate ref={target} reference={reference} container={container} {...rest}>
{children}
</DropdownTemplate>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ export const ToolboxDropdownDesktop = forwardRef<
{
reference: RefObject<HTMLElement>;
children: ReactNode;
container: Element;
}
>(function ToolboxDropdownDesktop({ reference, children, ...rest }, ref) {
>(function ToolboxDropdownDesktop({ reference, container, children, ...rest }, ref) {
const { style: s } = usePosition(reference, ref as RefObject<HTMLElement>, {
watch: true,
placement: 'bottom-end',
container,
});

return (
Expand Down