@@ -35,6 +35,7 @@ interface SelectorState {
3535 animation : string | false ;
3636 event : string ;
3737 hideItems : boolean ;
38+ customMountNode : boolean ;
3839 customPosition : boolean ;
3940 disableEnterAnimation : boolean ;
4041 disableExitAnimation : boolean ;
@@ -68,6 +69,7 @@ export function App() {
6869 animation : false ,
6970 event : selector . events [ 0 ] ,
7071 hideItems : false ,
72+ customMountNode : false ,
7173 customPosition : false ,
7274 disableEnterAnimation : false ,
7375 disableExitAnimation : false ,
@@ -81,6 +83,9 @@ export function App() {
8183 const { show } = useContextMenu ( {
8284 id : MENU_ID ,
8385 } ) ;
86+ const customMountNode = document . querySelector (
87+ `[data-test="${ DATA_TEST . MOUNT_NODE } "]`
88+ ) ;
8489
8590 function handleSelector ( {
8691 target : { name, value } ,
@@ -153,6 +158,17 @@ export function App() {
153158 />
154159 </ li >
155160 ) ) }
161+ < li >
162+ < label htmlFor = "customMountNode" > Use custom mount node</ label >
163+ < input
164+ type = "checkbox"
165+ id = "customMountNode"
166+ name = "customMountNode"
167+ checked = { state . customMountNode }
168+ onChange = { handleCheckboxes }
169+ data-test = { DATA_TEST . TOGGLE_MOUNT_NODE }
170+ />
171+ </ li >
156172 < li >
157173 < label htmlFor = "customPosition" > Use custom position</ label >
158174 < input
@@ -224,6 +240,7 @@ export function App() {
224240 theme = { state . theme }
225241 animation = { getAnimation ( ) }
226242 data-test = { DATA_TEST . CONTEXT_MENU }
243+ mountNode = { state . customMountNode ? customMountNode : null }
227244 >
228245 < Item
229246 onClick = { handleItemClick }
0 commit comments