-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: accessibility issues on Tree component, adjusting examples (#1703)
* fix: accessibility issues on Tree component, adjusting examples * replacing yarn.lock with master * cleaning code * cleaning code * fix: tree accesibility issues * fix: tree accesibility issues * fix: impriving code * fix: test * chore: fix yarn.lock * test: fix integration tests Co-authored-by: Tahimi <tahimileon@gmail.com> Co-authored-by: LeandroTorresSicilia <jtorressicilia@gmail.com>
- Loading branch information
1 parent
28c3626
commit eb42f71
Showing
17 changed files
with
311 additions
and
79 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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const getNodeLevel = ({ name = '' }) => { | ||
const levelMatch = name.match(/\./g); | ||
if (levelMatch) { | ||
return levelMatch.length + 1; | ||
} | ||
return 1; | ||
}; | ||
|
||
export default getNodeLevel; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const getNodeName = ({ parentName, index }) => { | ||
const nodeLevel = index + 1; | ||
if (parentName) { | ||
return `${parentName}.${nodeLevel}`; | ||
} | ||
return `node-${nodeLevel}`; | ||
}; | ||
|
||
export default getNodeName; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const getTabIndex = ({ selectedNode, isSelected, isFirstNode }) => { | ||
if (isSelected) { | ||
return 0; | ||
} | ||
if (!selectedNode && isFirstNode) { | ||
return 0; | ||
} | ||
return -1; | ||
}; | ||
|
||
export default getTabIndex; |
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
Oops, something went wrong.