Skip to content

Conversation

@micahgodbolt
Copy link
Member

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.

@size-auditor
Copy link

size-auditor bot commented Feb 21, 2023

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-Autofill 14.99 kB 15.042 kB ExceedsBaseline     52 bytes
office-ui-fabric-react fluentui-react-Pickers 280.313 kB 280.365 kB ExceedsBaseline     52 bytes
office-ui-fabric-react fluentui-react-ComboBox 237.962 kB 238.014 kB ExceedsBaseline     52 bytes
office-ui-fabric-react fluentui-react-TimePicker 226.957 kB 227.009 kB ExceedsBaseline     52 bytes
office-ui-fabric-react fluentui-react-ExtendedPicker 94.108 kB 94.16 kB ExceedsBaseline     52 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: 29ed7fb57a05a6595835f947193460886e80cfc5 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 21, 2023

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:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Feb 21, 2023

📊 Bundle size report

🤖 This report was generated against 29ed7fb57a05a6595835f947193460886e80cfc5

@fabricteam
Copy link
Collaborator

fabricteam commented Feb 21, 2023

Perf Analysis (@fluentui/react)

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

@micahgodbolt micahgodbolt enabled auto-merge (squash) February 21, 2023 22:42
@micahgodbolt micahgodbolt merged commit e7adfea into microsoft:master Feb 21, 2023
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Feb 24, 2023
* 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)
  ...
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Mar 15, 2023
…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)
  ...
micahgodbolt added a commit to micahgodbolt/fluentui that referenced this pull request Mar 24, 2023
micahgodbolt added a commit that referenced this pull request Mar 24, 2023
behowell pushed a commit that referenced this pull request Mar 24, 2023
Revert #26931 change due to new bug it introduced
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Mar 27, 2023
* 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)
  ...
@Hotell Hotell removed their assignment May 16, 2023
@micahgodbolt micahgodbolt deleted the combobox-jump-fix branch June 7, 2023 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cursor jumps to the end on selecting and editing text on freeform combobox

5 participants