Commit d5d51a7
authored
fix(eds-core-react): 🐛 Autocomplete - should start at selected index and preserve scroll position (#3996)
* fix(eds-core-react): 🐛 Autocomplete - enhance component with controlled highlighted index and improved scrolling behavior starting at selected index
* test(eds-core-react): ✅ Update Autocomplete snapshot to reflect changes in selected item styling and structure
* fix(eds-core-react): 🚨 Fixed lint error, missing brackets
* fix(eds-core-react): ♻️ re-added existing update for selected items on controlled prop change after copilot review
* test(eds-core-react): ✅ Add comprehensive tests for autocomplete scroll position and navigation memory
- Add 5 new test cases covering scroll position restoration for single-select mode
- Test selected option visibility when reopening dropdown
- Test keyboard navigation from preselected option position
- Test empty selection handling and multiselect compatibility
- Test behavior preservation across open/close cycles
- All tests pass and validate PR #3996 functionality
* test(eds-core-react): 📸 Update Autocomplete snapshot after dependency updates
- Update snapshot to reflect changes from main branch dependency updates
- All 27 tests passing including 5 new scroll position tests
- Resolves snapshot conflicts from rebase
* style(eds-core-react): 💄 Fix Prettier formatting in Autocomplete tests
- Fix formatting issues identified by lint:all
- Resolve all Prettier errors in test file
- No functional changes to tests
* test(eds-core-react): 📸 Update Autocomplete snapshot for Jest URL and attribute order
- Update Jest snapshot header URL
- Fix minor HTML attribute ordering differences
- All 27 tests passing including scroll position tests
* test(eds-core-react): 📸 Update Autocomplete snapshot after rebase to latest main
- Rebase onto latest main (3 new commits)
- Update snapshot to match latest dependencies
- All 27 tests passing including scroll position tests1 parent 3950502 commit d5d51a7
3 files changed
Lines changed: 270 additions & 25 deletions
File tree
- packages/eds-core-react/src/components/Autocomplete
- __snapshots__
Lines changed: 176 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
Lines changed: 93 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| |||
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
438 | 449 | | |
439 | 450 | | |
440 | 451 | | |
| |||
606 | 617 | | |
607 | 618 | | |
608 | 619 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
616 | | - | |
617 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
618 | 626 | | |
619 | 627 | | |
620 | 628 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
634 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
635 | 652 | | |
636 | 653 | | |
637 | 654 | | |
| |||
673 | 690 | | |
674 | 691 | | |
675 | 692 | | |
| 693 | + | |
| 694 | + | |
676 | 695 | | |
677 | 696 | | |
678 | 697 | | |
| |||
685 | 704 | | |
686 | 705 | | |
687 | 706 | | |
688 | | - | |
| 707 | + | |
689 | 708 | | |
690 | 709 | | |
691 | 710 | | |
692 | 711 | | |
693 | 712 | | |
694 | 713 | | |
| 714 | + | |
695 | 715 | | |
696 | 716 | | |
697 | | - | |
| 717 | + | |
698 | 718 | | |
699 | 719 | | |
700 | 720 | | |
701 | 721 | | |
702 | 722 | | |
703 | 723 | | |
| 724 | + | |
| 725 | + | |
704 | 726 | | |
705 | 727 | | |
| 728 | + | |
706 | 729 | | |
| 730 | + | |
707 | 731 | | |
708 | 732 | | |
709 | 733 | | |
| |||
717 | 741 | | |
718 | 742 | | |
719 | 743 | | |
720 | | - | |
721 | 744 | | |
722 | 745 | | |
723 | 746 | | |
724 | 747 | | |
725 | 748 | | |
726 | 749 | | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
727 | 757 | | |
728 | 758 | | |
729 | | - | |
| 759 | + | |
730 | 760 | | |
731 | 761 | | |
732 | 762 | | |
733 | 763 | | |
734 | 764 | | |
735 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
736 | 782 | | |
737 | | - | |
738 | 783 | | |
739 | 784 | | |
740 | 785 | | |
741 | 786 | | |
742 | 787 | | |
743 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
744 | 796 | | |
745 | 797 | | |
746 | | - | |
| 798 | + | |
747 | 799 | | |
748 | 800 | | |
749 | 801 | | |
750 | 802 | | |
751 | 803 | | |
752 | 804 | | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
753 | 821 | | |
754 | 822 | | |
755 | 823 | | |
756 | 824 | | |
| 825 | + | |
757 | 826 | | |
758 | 827 | | |
759 | 828 | | |
| |||
0 commit comments