Commit eac97a2
fix: improve touch interaction handling for submenus (#5867)
* fix: improve touch interaction handling for submenus
* chore: add changeset for menu touch interaction fix
* test: add comprehensive touch interaction tests for menu submenus
* fix(overlay): add null checks for window.__swc.warn in test environments
* fix(menu): correct PropertyValues check and improve touch event detection
* fix(menu): prevent duplicate pointerup listeners causing submenu to close and reopen
- Add _touchListenerActive flag to prevent multiple pointerup listeners from being registered
- Reset flag in handleTouchSubmenuToggle after action completes
- Prevents rapid close/reopen behavior when tapping on menu items with open submenus
* test(menu): improve test coverage for touch and pointer interactions
- Add click event dispatch after touch tap to cover handleSubmenuClick touch prevention
- Add touch pointerleave test to cover early return for touch devices
- Add test for pointerdown on open submenu followed by focus to cover handleSubmenuFocus
These targeted test enhancements improve coverage without adding entirely new test cases.
* refactor: resolve code review comments
* test: fix nested submenu touch interaction test
---------
Co-authored-by: Shipra Gupta <[email protected]>
Co-authored-by: Nikki Massaro <[email protected]>1 parent 7eb0007 commit eac97a2
File tree
5 files changed
+357
-6
lines changed- .changeset
- 1st-gen/packages
- overlay/src
5 files changed
+357
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
323 | 330 | | |
324 | 331 | | |
325 | 332 | | |
| |||
458 | 465 | | |
459 | 466 | | |
460 | 467 | | |
461 | | - | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
462 | 498 | | |
463 | 499 | | |
464 | 500 | | |
465 | | - | |
| 501 | + | |
466 | 502 | | |
467 | 503 | | |
468 | 504 | | |
469 | 505 | | |
470 | 506 | | |
471 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
472 | 537 | | |
473 | 538 | | |
474 | 539 | | |
| |||
614 | 679 | | |
615 | 680 | | |
616 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
617 | 688 | | |
618 | 689 | | |
619 | 690 | | |
| 691 | + | |
620 | 692 | | |
621 | 693 | | |
622 | 694 | | |
| |||
640 | 712 | | |
641 | 713 | | |
642 | 714 | | |
643 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
644 | 721 | | |
645 | 722 | | |
646 | 723 | | |
| |||
654 | 731 | | |
655 | 732 | | |
656 | 733 | | |
657 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
658 | 740 | | |
659 | 741 | | |
660 | 742 | | |
| |||
821 | 903 | | |
822 | 904 | | |
823 | 905 | | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
824 | 912 | | |
825 | 913 | | |
826 | 914 | | |
| |||
0 commit comments