-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-components): 3D resources Submenu disappear in FDX when hov…
…ered (#3570) * fixed Submenu disappear issue occuring in FDX when mouse cursor is hovered on the menu items * removed unused state in layerscontainer * updated appending of 3D resource components to use context of Div element Ref --------- Co-authored-by: cognite-bulldozer[bot] <51074376+cognite-bulldozer[bot]@users.noreply.github.com>
- Loading branch information
1 parent
db50158
commit 231f367
Showing
6 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
react-components/src/components/RevealContainer/RevealContainerElementContext.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*! | ||
* Copyright 2023 Cognite AS | ||
*/ | ||
|
||
import { createContext, useContext } from 'react'; | ||
|
||
export const RevealContainerElementContext = createContext<HTMLDivElement | null>(null); | ||
|
||
export const useRevealContainerElement = (): HTMLDivElement => { | ||
const element = useContext(RevealContainerElementContext); | ||
if (element === null) { | ||
throw new Error( | ||
'useRevealContainerElement must be used within a RevealContainerElementContextProvider' | ||
); | ||
} | ||
return element; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters