-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Tree): fix a regression in keyboard navigation
Since @react-aria/[email protected] getKeyLeftOf and getKeyRightOf is removed if orientation is vertical and layout is "stack". Using the single-argument overload of the base constructor doesn't set a default value for orientation (which seems a little random), which in turn makes the if statement that removes the methods not run. https://github.com/adobe/react-spectrum/blob/8228e4efd9be99973058a1f90fc7f7377e673f78/packages/%40react-aria/selection/src/ListKeyboardDelegate.ts#L67
- Loading branch information
1 parent
8215b39
commit f50ccab
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,19 @@ import React, { Key, RefObject } from "react"; | |
export class TreeKeyboardDelegate<T> extends ListKeyboardDelegate<T> { | ||
constructor( | ||
private collection: Collection<Node<T>>, | ||
private disabledKeys: Set<Key>, | ||
disabledKeys: Set<Key>, | ||
ref: RefObject<HTMLElement>, | ||
collator?: Intl.Collator | ||
) { | ||
super(collection, disabledKeys, ref, collator); | ||
super({ | ||
collection, | ||
disabledKeys, | ||
ref, | ||
collator, | ||
// Since @react-aria/[email protected] getKeyLeftOf and getKeyRightOf is | ||
// removed if orientation is vertical and layout is "stack". | ||
layout: "grid", | ||
}); | ||
} | ||
|
||
getKeyLeftOf(key: React.Key): React.Key { | ||
|