Fix action menu dropdown (#8368)
Fix action menu dropdown not closing when clicking outside the table or board and introduce helper functions to get the action menu component ids.
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
import { getActionBarIdFromActionMenuId } from '@/action-menu/utils/getActionBarIdFromActionMenuId';
|
||||
|
||||
describe('getActionBarIdFromActionMenuId', () => {
|
||||
it('should return the correct action bar id', () => {
|
||||
expect(getActionBarIdFromActionMenuId('action-menu-id')).toBe(
|
||||
'action-bar-action-menu-id',
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
import { getActionMenuDropdownIdFromActionMenuId } from '@/action-menu/utils/getActionMenuDropdownIdFromActionMenuId';
|
||||
|
||||
describe('getActionMenuDropdownIdFromActionMenuId', () => {
|
||||
it('should return the correct action menu dropdown id', () => {
|
||||
expect(getActionMenuDropdownIdFromActionMenuId('action-menu-id')).toBe(
|
||||
'action-menu-dropdown-action-menu-id',
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,9 @@
|
||||
import { getActionMenuIdFromRecordIndexId } from '@/action-menu/utils/getActionMenuIdFromRecordIndexId';
|
||||
|
||||
describe('getActionMenuIdFromRecordIndexId', () => {
|
||||
it('should return the correct action menu id', () => {
|
||||
expect(getActionMenuIdFromRecordIndexId('record-index-id')).toBe(
|
||||
'action-menu-record-index-record-index-id',
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,3 @@
|
||||
export const getActionBarIdFromActionMenuId = (actionMenuId: string) => {
|
||||
return `action-bar-${actionMenuId}`;
|
||||
};
|
||||
@ -0,0 +1,5 @@
|
||||
export const getActionMenuDropdownIdFromActionMenuId = (
|
||||
actionMenuId: string,
|
||||
) => {
|
||||
return `action-menu-dropdown-${actionMenuId}`;
|
||||
};
|
||||
@ -0,0 +1,3 @@
|
||||
export const getActionMenuIdFromRecordIndexId = (recordIndexId: string) => {
|
||||
return `action-menu-record-index-${recordIndexId}`;
|
||||
};
|
||||
Reference in New Issue
Block a user