Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

⚡ fix: avoid modal attachment menu overhead (#14847)

Danny Avilab0ed8524d48b
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', () => {