File tree Expand file tree Collapse file tree 2 files changed +25
-52
lines changed Expand file tree Collapse file tree 2 files changed +25
-52
lines changed Original file line number Diff line number Diff line change 343
343
const observer = new MutationObserver ((mutationList ) => {
344
344
for (const mutation of mutationList ) {
345
345
if (mutation .type === ' childList' ) {
346
- if (isVisible && savedMouseEvent ) {
346
+ // Only reposition if we don't have open submenus
347
+ // This prevents the menu from jumping when submenus open
348
+ if (isVisible && savedMouseEvent && ! submenuCoordination .hasOpenSubmenus ()) {
347
349
setPosition (savedMouseEvent );
348
350
}
349
351
}
Original file line number Diff line number Diff line change 171
171
contextMenu ?.close ();
172
172
}}
173
173
/>
174
+ <ContextMenuItemSubmenu label =" More actions" >
175
+ {#snippet submenu ({ close })}
176
+ <ContextMenuSection >
177
+ <ContextMenuItem
178
+ label =" Cherry-pick"
179
+ onclick ={() => {
180
+ console .log (' Cherry-pick' );
181
+ close ();
182
+ contextMenu ?.close ();
183
+ }}
184
+ />
185
+ <ContextMenuItem
186
+ label =" Rebase"
187
+ onclick ={() => {
188
+ console .log (' Rebase' );
189
+ close ();
190
+ contextMenu ?.close ();
191
+ }}
192
+ />
193
+ </ContextMenuSection >
194
+ {/ snippet }
195
+ </ContextMenuItemSubmenu >
174
196
</ContextMenuSection >
175
197
<ContextMenuSection title =" Branch operations" >
176
198
<ContextMenuItem
187
209
contextMenu ?.close ();
188
210
}}
189
211
/>
190
- <ContextMenuItem
191
- label =" Delete branch"
192
- onclick ={() => {
193
- console .log (' Delete branch' );
194
- contextMenu ?.close ();
195
- }}
196
- />
197
- <ContextMenuItem
198
- label =" Rename branch"
199
- onclick ={() => {
200
- console .log (' Rename branch' );
201
- contextMenu ?.close ();
202
- }}
203
- />
204
- <ContextMenuItem
205
- label =" Compare branches"
206
- onclick ={() => {
207
- console .log (' Compare branches' );
208
- contextMenu ?.close ();
209
- }}
210
- />
211
212
</ContextMenuSection >
212
213
<ContextMenuSection >
213
214
<ContextMenuItem
255
256
}}
256
257
/>
257
258
</ContextMenuSection >
258
- <ContextMenuSection >
259
- <ContextMenuItem
260
- label =" Clone"
261
- onclick ={() => {
262
- console .log (' Clone' );
263
- contextMenu ?.close ();
264
- }}
265
- />
266
- <ContextMenuItem
267
- label =" Fork"
268
- onclick ={() => {
269
- console .log (' Fork' );
270
- contextMenu ?.close ();
271
- }}
272
- />
273
- <ContextMenuItem
274
- label =" Archive"
275
- onclick ={() => {
276
- console .log (' Archive' );
277
- contextMenu ?.close ();
278
- }}
279
- />
280
- <ContextMenuItem
281
- label =" Settings"
282
- onclick ={() => {
283
- console .log (' Settings' );
284
- contextMenu ?.close ();
285
- }}
286
- />
287
- </ContextMenuSection >
288
259
</ContextMenu >
289
260
{/ snippet }
290
261
</Story >
You can’t perform that action at this time.
0 commit comments