Skip to content
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

Table/DataGrid: keyboard resizing improvements #28493

Conversation

george-cz
Copy link
Contributor

@george-cz george-cz commented Jul 11, 2023

Previous Behavior

Previously when keyboard column resizing was enabled, the focus would be moved to the body to avoid conflict with Tabster. This has some downsides specifically when screen readers are being used.

New Behavior

The new behavior keeps the focus on the resize handle while user is resizing with the arrows. To make sure the handle is not focusable, the handles initially have no tabIndex. The tabIndex is then set to 0 when the keyboard resizing is enabled, and the handle is focused. This is reverted when the handle is blurred, or ESC, Space or Enter are pressed during the keyboard resizing.

The handle also now has a "separator" role, which is more in line to what we would expect for screen reader support. As the columns are resized, the current width is read in real time.

I also removed some of the support code for the previous solution and its workarounds.

Related Issue(s)

@george-cz george-cz requested review from a team as code owners July 11, 2023 13:57
@george-cz george-cz changed the title Jirivyhnalek/table keyboard resize improvements Table/DataGrid: keyboard resizing improvements Jul 11, 2023
@fabricteam
Copy link
Collaborator

fabricteam commented Jul 11, 2023

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme mount 74 84 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 594 577 5000
Button mount 303 291 5000
Field mount 1011 1063 5000
FluentProvider mount 653 630 5000
FluentProviderWithTheme mount 74 84 10 Possible regression
FluentProviderWithTheme virtual-rerender 65 69 10
FluentProviderWithTheme virtual-rerender-with-unmount 71 73 10
InfoButton mount 10 12 5000
MakeStyles mount 863 831 50000
Persona mount 1646 1604 5000
SpinButton mount 1340 1336 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 11, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-table
DataGrid
158.674 kB
43.399 kB
158.216 kB
42.389 kB
-458 B
-1.01 kB
react-table
Table (Primitives only)
44.692 kB
12.447 kB
43.95 kB
12.263 kB
-742 B
-184 B
react-table
Table as DataGrid
132.761 kB
34.005 kB
132.019 kB
33.82 kB
-742 B
-185 B
react-table
Table (Selection only)
78.385 kB
19.379 kB
77.643 kB
19.195 kB
-742 B
-184 B
react-table
Table (Sort only)
77.004 kB
18.981 kB
76.262 kB
18.798 kB
-742 B
-183 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
67.576 kB
18.225 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
213.111 kB
59.12 kB
react-components
react-components: FluentProvider & webLightTheme
36.409 kB
12.003 kB
react-portal-compat
PortalCompatProvider
6.48 kB
2.203 kB
🤖 This report was generated against 67204719005015e0af0e272fd86d44fc02e1e0a0

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 13, 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 46fa55f:

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

@size-auditor
Copy link

size-auditor bot commented Jul 13, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 67204719005015e0af0e272fd86d44fc02e1e0a0 (build)

@george-cz george-cz enabled auto-merge (squash) July 21, 2023 14:04
@george-cz george-cz merged commit 39cf021 into microsoft:master Jul 24, 2023
21 checks passed
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Jul 25, 2023
* master: (32 commits)
  chore: remove @fluentui/bundle-size (microsoft#28601)
  Breadcrumb UI adjustments (microsoft#28578)
  feat(tools): re-generate react-components.api.md when preparing 1st stable release (microsoft#28561)
  perf(tools): make dependency-mismatch execution 90% faster and ignore */>=9.0.0-alpha versions (microsoft#28597)
  Table/DataGrid: keyboard resizing improvements (microsoft#28493)
  docs(react-tooltip): Add info icon + tooltip story to Tooltip stories (microsoft#28611)
  chore: Updating @fluentui/react-icons to version 2.0.207 (microsoft#28590)
  feat: allSelectedRows and someSelectedRows should be more reliable (microsoft#28577)
  add vr test to react-tags (microsoft#28484)
  applying package updates
  chore: migrate to monosize (microsoft#26826)
  fix(react-conformance): add @swc/helpers to deps instead of tslib as we use swc for transpilation (microsoft#28599)
  fix: MenuItem content should be spaced 12px from the boundary (microsoft#28162)
  feat: implements selection (microsoft#28497)
  bugfix: moves handleBackdropClick from defaultProps to an override (microsoft#28579)
  Fix empty CSS creation (microsoft#28566)
  chore: replace plop with nx within create-* aliases in root package.json (microsoft#28575)
  applying package updates
  fix: High contrast mode hover style icon fixes in react-button components (microsoft#28156)
  SplitButton: updated border right token for primary variant (microsoft#28555)
  ...
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.

Bug: v9 DataGrid resizable columns with keyboard sends focus to document.body
5 participants