Commit 960b7cf
fix(select): don't restore focus unless an option was selected (#8964)
Currently `mat-select` always restores focus to its trigger whenever the panel is closed. This can be problematic, because the user might've scrolled away and restoring focus would scroll the page back up. These changes switch to only restoring focus if the user made a selection.
Fixes #8915.1 parent 92896a0 commit 960b7cf
2 files changed
+24
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
2522 | 2541 | | |
2523 | 2542 | | |
2524 | 2543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | 551 | | |
553 | 552 | | |
554 | 553 | | |
| |||
715 | 714 | | |
716 | 715 | | |
717 | 716 | | |
| 717 | + | |
| 718 | + | |
718 | 719 | | |
719 | | - | |
720 | 720 | | |
721 | 721 | | |
722 | 722 | | |
| |||
844 | 844 | | |
845 | 845 | | |
846 | 846 | | |
847 | | - | |
| 847 | + | |
848 | 848 | | |
| 849 | + | |
849 | 850 | | |
850 | 851 | | |
851 | 852 | | |
| |||
0 commit comments