Commit 4170e5b
authored
fix(tldraw): right-clicking a page item opens its submenu (tldraw#8927)
In order to let users right-click page items in the page menu without
accidentally starting a drag-to-reorder gesture, this PR ignores
non-primary buttons on the page item drag handle and wires the page
item's `onContextMenu` to open the per-item submenu. The open submenu is
tracked through the editor menu manager so it closes together with the
page menu.
### Change type
- [x] `bugfix`
### Test plan
1. Open the page menu with multiple pages.
2. Right-click on a page item.
3. Confirm the page item's submenu opens (duplicate, move up/down,
delete, etc.).
4. Confirm the pages are not reordered as a result of the right-click.
5. Close the page menu and confirm any open per-item submenu is also
closed.
- [x] End to end tests
### Release notes
- Fixed a bug where right-clicking a page item in the page menu could
start a drag-to-reorder gesture instead of opening the item's submenu.
### API changes
- none
### Code changes
| Section | LOC change |
| --------- | ---------- |
| Core code | +40 / -1 |
| Tests | +18 / -0 |1 parent 9caa949 commit 4170e5b
3 files changed
Lines changed: 59 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
459 | 477 | | |
460 | 478 | | |
461 | 479 | | |
| |||
Lines changed: 40 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
| |||
342 | 363 | | |
343 | 364 | | |
344 | 365 | | |
| 366 | + | |
| 367 | + | |
345 | 368 | | |
346 | 369 | | |
347 | 370 | | |
| |||
400 | 423 | | |
401 | 424 | | |
402 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
403 | 437 | | |
404 | 438 | | |
405 | 439 | | |
| |||
533 | 567 | | |
534 | 568 | | |
535 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
536 | 575 | | |
537 | 576 | | |
538 | 577 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
0 commit comments