diff --git a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx index c18fd3ce72..8c35af1747 100644 --- a/client/src/components/Chat/Input/Files/AttachFileMenu.tsx +++ b/client/src/components/Chat/Input/Files/AttachFileMenu.tsx @@ -344,7 +344,8 @@ const AttachFileMenu = ({ className="overflow-visible" isOpen={isPopoverActive} setIsOpen={setIsPopoverActive} - modal={true} + modal={false} + portal={true} unmountOnHide={true} trigger={menuTrigger} items={dropdownItems} diff --git a/client/src/components/Chat/Input/Files/__tests__/AttachFileMenu.spec.tsx b/client/src/components/Chat/Input/Files/__tests__/AttachFileMenu.spec.tsx index 3f86cb5102..4393f81918 100644 --- a/client/src/components/Chat/Input/Files/__tests__/AttachFileMenu.spec.tsx +++ b/client/src/components/Chat/Input/Files/__tests__/AttachFileMenu.spec.tsx @@ -49,7 +49,11 @@ jest.mock('@librechat/client', () => { DropdownPopup: (props) => R.createElement( 'div', - null, + { + 'data-testid': 'dropdown-popup', + 'data-modal': props.modal, + 'data-portal': props.portal, + }, R.createElement('div', { onClick: () => props.setIsOpen(!props.isOpen) }, props.trigger), props.isOpen && R.createElement( @@ -262,6 +266,13 @@ describe('AttachFileMenu', () => { renderMenu({ disabled: false }); expect(screen.getByRole('button', { name: /attach file options/i })).not.toBeDisabled(); }); + + it('portals the menu without making the conversation tree inert', () => { + setupMocks(); + renderMenu(); + expect(screen.getByTestId('dropdown-popup')).toHaveAttribute('data-modal', 'false'); + expect(screen.getByTestId('dropdown-popup')).toHaveAttribute('data-portal', 'true'); + }); }); describe('Agent Capabilities', () => {