@@ -35,6 +35,7 @@ interface SelectorState {
35
35
animation : string | false ;
36
36
event : string ;
37
37
hideItems : boolean ;
38
+ customMountNode : boolean ;
38
39
customPosition : boolean ;
39
40
disableEnterAnimation : boolean ;
40
41
disableExitAnimation : boolean ;
@@ -68,6 +69,7 @@ export function App() {
68
69
animation : false ,
69
70
event : selector . events [ 0 ] ,
70
71
hideItems : false ,
72
+ customMountNode : false ,
71
73
customPosition : false ,
72
74
disableEnterAnimation : false ,
73
75
disableExitAnimation : false ,
@@ -81,6 +83,9 @@ export function App() {
81
83
const { show } = useContextMenu ( {
82
84
id : MENU_ID ,
83
85
} ) ;
86
+ const customMountNode = document . querySelector (
87
+ `[data-test="${ DATA_TEST . MOUNT_NODE } "]`
88
+ ) ;
84
89
85
90
function handleSelector ( {
86
91
target : { name, value } ,
@@ -153,6 +158,17 @@ export function App() {
153
158
/>
154
159
</ li >
155
160
) ) }
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 >
156
172
< li >
157
173
< label htmlFor = "customPosition" > Use custom position</ label >
158
174
< input
@@ -224,6 +240,7 @@ export function App() {
224
240
theme = { state . theme }
225
241
animation = { getAnimation ( ) }
226
242
data-test = { DATA_TEST . CONTEXT_MENU }
243
+ mountNode = { state . customMountNode ? customMountNode : null }
227
244
>
228
245
< Item
229
246
onClick = { handleItemClick }
0 commit comments