-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Cherry pick/selectionzone keyboard options #23572
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
Cherry pick/selectionzone keyboard options #23572
Conversation
Cherry picked from master. * selectionzone: add override for escape key behavior Prior to this change pressing the escape key would deselect any selected elements within the SelectionZone and stop event propagation. This commit adds a prop called `selectionClearedOnEscapePress` to SelectionZone that allows this behavior to be configured. The default value is `true` which preserves the prior behavior. When this value is set to `false`, presses to the escape key will not change the selection in any way and the SelectionZone will not stop the event propgation. * detailslist: configure selectionzone based on `isSelectedOnFocus` Configures the behavior of DetailsList's internal SelectionZone based on the value of `isSelectedOnFocus`. * selectionzone: adds prop to override default space key toggle behavior By default a SelectionZone inside a DetailsList requires users to press `ctrl/meta + space` to toggle values. Simply pressing `space` will deselect all selected values and select the focused value. No change happens when pressing `space` on a selected item. This change adds a `toggleWithoutModifierPressed` to `SelectionZone` that allows users to opt out of this behavior and get the multi-select toggle behavior with just the `space` key. DetailsLists makes use of this be opting out of the default behavior when `isSelectedOnFocus` is set to true. * detailslist: add keyboard override example Adds an example demonstrating the `isSelectedOnFocus` keyboard overrides for DetailsList. * change files * update @fluentui/react api snapshot * add detailslist keyboard overrides example to public docsite * update docsite detailslist page files * selectionzone: make mouse clicks work correctly with toggle override There is a code path in SelectionZone that disables part of the mouse handling code when a modifier is pressed. This commit updates the component to use that path based on the value of `toggleWithoutModifierPressed`. Co-authored-by: Sarah Higley <sarah.higley@microsoft.com>
|
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 f4f043b:
|
Asset size changes
Baseline commit: 0213db95dea2f397de467d3f53f6fef0a7f7df68 (build) |
Perf AnalysisNo significant results to display. All results
|
|
I've accepted the Screener changes as they are all related to known issues (images loading/not loading, etc). |
change/office-ui-fabric-react-455240a9-56cb-4a28-aa11-b816be45a99d.json
Outdated
Show resolved
Hide resolved
…a99d.json Co-authored-by: Makoto Morimoto <Humberto.Morimoto@microsoft.com>
|
@ThomasMichon could you take a look at this please? |
Cherry picks a change from
masterthat adds keyboard behavior overrides toSelectionZone.Original pull request: #23487