mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-29 05:20:49 +00:00
⚡ fix: avoid modal attachment menu overhead (#14847)
This commit is contained in:
parent
e1178d3c65
commit
b0ed8524d4
2 changed files with 14 additions and 2 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue