fix: avoid modal attachment menu overhead (#14847)

This commit is contained in:
Danny Avila 2026-08-14 16:15:47 -04:00 committed by GitHub
parent e1178d3c65
commit b0ed8524d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View file

@ -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}

View file

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