Store context menu open in app wide state to disable all hover effects which cause rerenders and mess up the context menu
Summary: Mouse over event still fires for the dom nodes behind the context menu modal. This will cause state changes and rerenders. Some of the state the context menu depends on can change so it would cause the context menu items to change while its stil open. Now we dont fire those hover state changes while context menu active Reviewed By: lblasa Differential Revision: D41494947 fbshipit-source-id: 17918f15d74230d9c7070a4de7a0a0ce10a08001
This commit is contained in:
committed by
Facebook GitHub Bot
parent
32fe3948d9
commit
f78899b69f
@@ -48,6 +48,9 @@ export function plugin(client: PluginClient<Events>) {
|
||||
perfEvents.append(event);
|
||||
});
|
||||
|
||||
//used to disabled hover effects which cause rerenders and mess up the existing context menu
|
||||
const isContextMenuOpen = createState<boolean>(false);
|
||||
|
||||
const focusedNode = createState<Id | undefined>(undefined);
|
||||
|
||||
const nodes = createState<Map<Id, UINode>>(new Map());
|
||||
@@ -108,6 +111,7 @@ export function plugin(client: PluginClient<Events>) {
|
||||
|
||||
return {
|
||||
rootId,
|
||||
isContextMenuOpen,
|
||||
nodes,
|
||||
metadata,
|
||||
focusedNode,
|
||||
|
||||
Reference in New Issue
Block a user