-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix(list): address accessibility console error #920
Open
katie-bobbe-genesys
wants to merge
3
commits into
main
Choose a base branch
from
feature/COMUI-3499
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ const validFocusableItems = ['gux-list-item']; | |
@Component({ | ||
styleUrl: 'gux-list.scss', | ||
tag: 'gux-list', | ||
shadow: { delegatesFocus: true } | ||
shadow: true | ||
}) | ||
export class GuxList { | ||
@Element() | ||
|
@@ -84,14 +84,9 @@ export class GuxList { | |
last(this.root, validFocusableItems); | ||
} | ||
|
||
private renderFocusTarget(): JSX.Element { | ||
return (<span tabindex="-1" aria-hidden="true"></span>) as JSX.Element; | ||
} | ||
|
||
render(): JSX.Element { | ||
return ( | ||
<Host role="list"> | ||
{this.renderFocusTarget()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an issue with having this focus target element. Both of the following cause accessibility issues
I have removed this focus target span and instead put a tab index of |
||
<Host tabindex="-1" role="list"> | ||
<slot></slot> | ||
</Host> | ||
) as JSX.Element; | ||
|
2 changes: 1 addition & 1 deletion
2
...-spark-components/src/components/stable/gux-list/tests/__snapshots__/gux-list.e2e.ts.snap
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`gux-list #render should render component as expected 1`] = `"<gux-list role="list" hydrated=""><template shadowrootmode="open"><span tabindex="-1" aria-hidden="true"></span><slot></slot></template> <gux-list-item role="listitem" hydrated="">Test1</gux-list-item> <gux-list-divider role="presentation" hydrated=""></gux-list-divider> <gux-list-item role="listitem" hydrated="">Test2</gux-list-item> <gux-list-item role="listitem" hydrated="">Test3</gux-list-item> <gux-list-item role="listitem" hydrated="">Test4</gux-list-item> </gux-list>"`; | ||
exports[`gux-list #render should render component as expected 1`] = `"<gux-list tabindex="-1" role="list" hydrated=""><template shadowrootmode="open"><slot></slot></template> <gux-list-item role="listitem" hydrated="">Test1</gux-list-item> <gux-list-divider role="presentation" hydrated=""></gux-list-divider> <gux-list-item role="listitem" hydrated="">Test2</gux-list-item> <gux-list-item role="listitem" hydrated="">Test3</gux-list-item> <gux-list-item role="listitem" hydrated="">Test4</gux-list-item> </gux-list>"`; |
3 changes: 1 addition & 2 deletions
3
...spark-components/src/components/stable/gux-list/tests/__snapshots__/gux-list.spec.ts.snap
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
8 changes: 4 additions & 4 deletions
8
...park-components/src/components/stable/gux-popup/tests/__snapshots__/gux-popup.e2e.ts.snap
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`gux-popup should display component as expected (1) 1`] = `"<gux-popup hydrated=""><template shadowrootmode="open"><div class="gux-target-container" aria-disabled="false"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
exports[`gux-popup should display component as expected (1) 1`] = `"<gux-popup hydrated=""><template shadowrootmode="open"><div class="gux-target-container" aria-disabled="false"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" tabindex="-1" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
|
||
exports[`gux-popup should display component as expected (2) 1`] = `"<gux-popup expanded="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container" aria-disabled="false"><slot name="target"></slot><div class="gux-popup-container gux-expanded" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
exports[`gux-popup should display component as expected (2) 1`] = `"<gux-popup expanded="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container" aria-disabled="false"><slot name="target"></slot><div class="gux-popup-container gux-expanded" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" tabindex="-1" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
|
||
exports[`gux-popup should display component as expected (3) 1`] = `"<gux-popup disabled="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container gux-disabled" aria-disabled="true"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
exports[`gux-popup should display component as expected (3) 1`] = `"<gux-popup disabled="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container gux-disabled" aria-disabled="true"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" tabindex="-1" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
|
||
exports[`gux-popup should display component as expected (4) 1`] = `"<gux-popup expanded="" disabled="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container gux-disabled" aria-disabled="true"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; | ||
exports[`gux-popup should display component as expected (4) 1`] = `"<gux-popup expanded="" disabled="" hydrated=""><template shadowrootmode="open"><div class="gux-target-container gux-disabled" aria-disabled="true"><slot name="target"></slot><div class="gux-popup-container" style="width: 784px; overflow: hidden; left: 8px; top: 42px;"><slot name="popup"></slot></div></div></template> <gux-button slot="target" hydrated="">Target</gux-button> <gux-list slot="popup" tabindex="-1" role="list" hydrated=""> <gux-list-item role="listitem" hydrated="">Item 1</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 2</gux-list-item> <gux-list-item role="listitem" hydrated="">Item 3</gux-list-item> </gux-list> </gux-popup>"`; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daragh-king-genesys I am tagging you here because you seem to be the one who added this code. Can you remember if this code has any utility that I may be overlooking? I am removing it because it is causing unwanted focus behavior after my changes in the
gux-list
file.