fix: Modal backdrop overlapping `Select` options (#32640)
parent
5f95c4ec6b
commit
9c925a39a6
@ -0,0 +1,5 @@ |
||||
--- |
||||
'@rocket.chat/meteor': patch |
||||
--- |
||||
|
||||
Fixes the issue where the modal backdrop is overlapping the options of the `Select` component |
||||
@ -1,13 +1,13 @@ |
||||
import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; |
||||
import { useEffectEvent } from '@rocket.chat/fuselage-hooks'; |
||||
|
||||
import type { GenericMenuItemProps } from '../GenericMenuItem'; |
||||
|
||||
export const useHandleMenuAction = (items: GenericMenuItemProps[], close?: () => void) => { |
||||
return useMutableCallback((id) => { |
||||
export const useHandleMenuAction = (items: GenericMenuItemProps[], callbackAction?: () => void) => { |
||||
return useEffectEvent((id) => { |
||||
const item = items.find((item) => item.id === id && !!item.onClick); |
||||
if (item) { |
||||
item.onClick?.(); |
||||
close?.(); |
||||
callbackAction?.(); |
||||
} |
||||
}); |
||||
}; |
||||
|
||||
Loading…
Reference in new issue