mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-13 02:30:29 +03:00
Add afterClose param to reusabel context menu
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
c50565dfda
commit
e67abae3e0
3 changed files with 8 additions and 3 deletions
|
|
@ -23,12 +23,14 @@ function ReusableContextMenu() {
|
|||
openerRef.current.style.height = `${cords.height}px`;
|
||||
openerRef.current.click();
|
||||
}
|
||||
const handleContextMenuOpen = (placement, cords, render) => {
|
||||
const handleContextMenuOpen = (placement, cords, render, afterClose) => {
|
||||
if (key) {
|
||||
closeMenu();
|
||||
return;
|
||||
}
|
||||
setData({ placement, cords, render });
|
||||
setData({
|
||||
placement, cords, render, afterClose,
|
||||
});
|
||||
};
|
||||
navigation.on(cons.events.navigation.REUSABLE_CONTEXT_MENU_OPENED, handleContextMenuOpen);
|
||||
return () => {
|
||||
|
|
@ -44,6 +46,7 @@ function ReusableContextMenu() {
|
|||
key = Math.random();
|
||||
return;
|
||||
}
|
||||
data?.afterClose?.();
|
||||
if (setData) setData(null);
|
||||
|
||||
if (key === null) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue