-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Combobox: Fix cursor jumping to the end of input #26931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combobox: Fix cursor jumping to the end of input #26931
Conversation
Asset size changes
Baseline commit: 29ed7fb57a05a6595835f947193460886e80cfc5 (build) |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 457e08a:
|
📊 Bundle size report🤖 This report was generated against 29ed7fb57a05a6595835f947193460886e80cfc5 |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| TeachingBubble | mount | 98149 | 55767 | 5000 | Possible regression |
All results
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 1185 | 1177 | 5000 | |
| Breadcrumb | mount | 2993 | 2912 | 1000 | |
| Checkbox | mount | 2637 | 2611 | 5000 | |
| CheckboxBase | mount | 2373 | 2362 | 5000 | |
| ChoiceGroup | mount | 4442 | 4445 | 5000 | |
| ComboBox | mount | 1247 | 1254 | 1000 | |
| CommandBar | mount | 9484 | 9591 | 1000 | |
| ContextualMenu | mount | 14018 | 13974 | 1000 | |
| DefaultButton | mount | 1373 | 1379 | 5000 | |
| DetailsRow | mount | 3456 | 3470 | 5000 | |
| DetailsRowFast | mount | 3459 | 3470 | 5000 | |
| DetailsRowNoStyles | mount | 3299 | 3307 | 5000 | |
| Dialog | mount | 3113 | 3106 | 1000 | |
| DocumentCardTitle | mount | 573 | 586 | 1000 | |
| Dropdown | mount | 3204 | 3222 | 5000 | |
| FocusTrapZone | mount | 2030 | 1999 | 5000 | |
| FocusZone | mount | 1978 | 1963 | 5000 | |
| GroupedList | mount | 52057 | 59006 | 2 | |
| GroupedList | virtual-rerender | 24498 | 24588 | 2 | |
| GroupedList | virtual-rerender-with-unmount | 92571 | 93999 | 2 | |
| GroupedListV2 | mount | 563 | 572 | 2 | |
| GroupedListV2 | virtual-rerender | 542 | 543 | 2 | |
| GroupedListV2 | virtual-rerender-with-unmount | 571 | 565 | 2 | |
| IconButton | mount | 1906 | 1906 | 5000 | |
| Label | mount | 731 | 720 | 5000 | |
| Layer | mount | 4352 | 4310 | 5000 | |
| Link | mount | 836 | 826 | 5000 | |
| MenuButton | mount | 1678 | 1685 | 5000 | |
| MessageBar | mount | 2312 | 2292 | 5000 | |
| Nav | mount | 3289 | 3270 | 1000 | |
| OverflowSet | mount | 1361 | 1341 | 5000 | |
| Panel | mount | 2566 | 2541 | 1000 | |
| Persona | mount | 1299 | 1328 | 1000 | |
| Pivot | mount | 1623 | 1626 | 1000 | |
| PrimaryButton | mount | 1518 | 1527 | 5000 | |
| Rating | mount | 6954 | 6933 | 5000 | |
| SearchBox | mount | 1497 | 1545 | 5000 | |
| Shimmer | mount | 2891 | 2895 | 5000 | |
| Slider | mount | 2093 | 2083 | 5000 | |
| SpinButton | mount | 4667 | 4646 | 5000 | |
| Spinner | mount | 813 | 803 | 5000 | |
| SplitButton | mount | 3063 | 3098 | 5000 | |
| Stack | mount | 840 | 833 | 5000 | |
| StackWithIntrinsicChildren | mount | 2301 | 2333 | 5000 | |
| StackWithTextChildren | mount | 4742 | 4742 | 5000 | |
| SwatchColorPicker | mount | 11293 | 10461 | 5000 | |
| TagPicker | mount | 2657 | 2652 | 5000 | |
| TeachingBubble | mount | 98149 | 55767 | 5000 | Possible regression |
| Text | mount | 806 | 788 | 5000 | |
| TextField | mount | 1593 | 1566 | 5000 | |
| ThemeProvider | mount | 1527 | 1558 | 5000 | |
| ThemeProvider | virtual-rerender | 1086 | 1074 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 2139 | 2158 | 5000 | |
| Toggle | mount | 1110 | 1086 | 5000 | |
| buttonNative | mount | 545 | 538 | 5000 |
Co-authored-by: Sarah Higley <[email protected]>
* master: (93 commits) chore: migrate to jest 27 (microsoft#26835) chore: make lint task run without need of build (microsoft#26872) chore(react-table): exports UseTableSelectionOptions (microsoft#26892) applying package updates fix(react-card): allow elements to grow to fill the available space (microsoft#26616) fix: Popover without focus trap should not be aria-hidden (microsoft#26932) applying package updates applying package updates fix(react-combobox): Remove _getAriaActiveDescendantValue, compute aria-activedescendantvalue in state, and update currentPendingValue when the options change (microsoft#26574) fix: v8 Combobox role and accname for non-hidden icon button (microsoft#26905) fix: Removing possible recursive loop in Coachmark (microsoft#26934) Combobox: Fix cursor jumping to the end of input (microsoft#26931) Fix missing icons on website (microsoft#26797) fix: Fix the width of Input's focus border with appearance=underline (microsoft#26881) chore: Clean up Input's interactive styles (microsoft#26865) Remove codeowners from change files (microsoft#26935) chore: add splitbutton error warning to docs, remove button ariaDescription example (microsoft#26904) docs: Remove testing code from MenuList example (microsoft#26929) chore: refactor SpinButton to use makeResetStyles (microsoft#26867) feat: Set overflow on positioned element when `autosize` is applied (microsoft#26868) ...
…r-component * feat/drawer-base-component: (141 commits) remove DrawerContainer feat: WIP add initial draft for Drawer and DrawerContainer chore: migrate to jest 27 (microsoft#26835) chore: make lint task run without need of build (microsoft#26872) chore(react-table): exports UseTableSelectionOptions (microsoft#26892) applying package updates fix(react-card): allow elements to grow to fill the available space (microsoft#26616) fix: Popover without focus trap should not be aria-hidden (microsoft#26932) applying package updates applying package updates fix(react-combobox): Remove _getAriaActiveDescendantValue, compute aria-activedescendantvalue in state, and update currentPendingValue when the options change (microsoft#26574) fix: v8 Combobox role and accname for non-hidden icon button (microsoft#26905) fix: Removing possible recursive loop in Coachmark (microsoft#26934) Combobox: Fix cursor jumping to the end of input (microsoft#26931) Fix missing icons on website (microsoft#26797) fix: Fix the width of Input's focus border with appearance=underline (microsoft#26881) chore: Clean up Input's interactive styles (microsoft#26865) Remove codeowners from change files (microsoft#26935) chore: add splitbutton error warning to docs, remove button ariaDescription example (microsoft#26904) docs: Remove testing code from MenuList example (microsoft#26929) ...
Revert #26931 change due to new bug it introduced
* master: (47 commits) fix: Fix vertical alignment of inline Checkbox when checked vs. unchecked (microsoft#27324) applying package updates Fix: Revert microsoft#26931 change due to new bug it introduced (microsoft#27323) chore(react-infobutton): Renaming content slot to info (microsoft#27316) applying package updates Fix bad release mismatch of react-select (microsoft#27321) applying package updates Fix react-combobox mismatch after bad release (microsoft#27319) docs: add section about media query sorting (microsoft#27307) applying package updates fix: sync packages and changefiles after bad release (microsoft#27317) applying package updates chore(react-datepicker-compat): Cleanup types, unused code, and restore utils tests (microsoft#27297) [Fluent 2 Theme] Fixing link color in dark theme (microsoft#27203) Tree documentation and stories (microsoft#27270) feat: Render theme CSS variables in SSR style element (microsoft#27277) chore (scripts): update create-package plop templates to use swc/helpers in deps (microsoft#27286) fix(DialogContent): adds padding to allow focus visibility (microsoft#27248) Adding Card component style hooks to shared context (microsoft#27295) Virtualizer: Static scroll hooks and embedded scrollview (microsoft#26985) ...
fixes #18499
In the past, changes to the Autofill component updated internal state and then called the onChange callback. This callback then calculated the new value and updated the value on via getDerivedStateFromProps. This meant that local state updated, component re-renders, but since value is still controlled (and hasn't changed yet), the cursor jumps to the end of the text. After that re-render the value DOES update, but not until after the cursor already jumped.
This change makes it so internal state is not updated if updateValueInWillReceiveProps is defined.