-
Notifications
You must be signed in to change notification settings - Fork 2.9k
chore: Clean up Input's interactive styles #26865
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
chore: Clean up Input's interactive styles #26865
Conversation
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 13ccc5915ca86262762f735456f7afe05bd9e537 (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 00947ba:
|
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1265 | 1284 | 5000 | |
| Button | mount | 920 | 923 | 5000 | |
| Field | mount | 1929 | 1971 | 5000 | |
| FluentProvider | mount | 1521 | 1535 | 5000 | |
| FluentProviderWithTheme | mount | 585 | 588 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 545 | 552 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 573 | 574 | 10 | |
| InfoButton | mount | 511 | 516 | 5000 | |
| MakeStyles | mount | 1954 | 1946 | 50000 | |
| Persona | mount | 2807 | 2805 | 5000 | |
| SpinButton | mount | 2302 | 2307 | 5000 |
📊 Bundle size report
Unchanged fixtures
|
…d not all of the focus, etc. styles.
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-input/src/components/Input/useInputStyles.ts
Outdated
Show resolved
Hide resolved
…nput/interactive-reset-styles
…ehowell/fluentui into input/interactive-reset-styles
* 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) ...

Previous Behavior
A previous PR #26815 refactored Input to use makeResetStyles to reduce the number of classes added to Inputs. In it, there were two different reset classes based on whether or not the input was enabled. This resulted in it conditionally calling one of two hooks:
As pointed out by @spmonahan in #26815 (comment), this technically breaks the rules of hooks by conditionally changing which hooks are called.
New Behavior
Have only a single
useRootClassName, which applies the styles for enabled ("interactive") inputs. Merge in all of the interactive styles into their base classes as well.Update the
disabledclass to override these hover/focus styles so that the disabled state does not inherit interactive styling.Related Issue(s)