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

Update tab indicator implementation #578

Merged
merged 4 commits into from
Jul 31, 2020

Conversation

arnoldsandoval-okta
Copy link
Contributor

@arnoldsandoval-okta arnoldsandoval-okta commented Jul 30, 2020

Updates implementation so that aria-selected handles the display of the tab indicator line as opposed to handling positioning via JS (fixes #564)

cc: @mattkaniaris-okta

Copy link
Contributor

@edburyenegren-okta edburyenegren-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - like this change even if it makes the visuals a little less exciting.

Copy link
Contributor

@jmelberg-okta jmelberg-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Few comments + 1 change needed.

Donuts
<div id="user-profile-tabs" class="ods-tabs" label="User profile options">
<div role="tablist" aria-label="" class="ods-tabs--tablist">
<button role="tab" id="tab-applications" aria-selected="true" tabindex="0" aria-controls="tab-applications-tabpanel" class="ods-tabs--tab">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an FYI - this isn't a required aria attribute and isn't compatible with web components. Material UI and Polaris do not use these labels either.

In the future it would be nice to outline attributes as either MUST or SHOULD be implemented, since it'll depend on the technology used by consumers.

}
else if (key === 'End') {
this.tabLast()
switch (key) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a default case here to pick up all other key types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason for us to pick up any other keys. I'll admit this felt a little weird to me too, but since it was obvious we only needed to answer for those specific cases/keys I went with it. Would you prefer if I went back to a conditional?

@arnoldsandoval-okta arnoldsandoval-okta merged commit ddbfe3d into develop Jul 31, 2020
arnoldsandoval-okta added a commit that referenced this pull request Jul 31, 2020
* updates tab component implementation to remove tab indicator positioned by JS (fixes #564)

* add default to switch statement which handles tab keyboard events
@arnoldsandoval-okta arnoldsandoval-okta deleted the bugfix/as-564-update-tab-indicator branch November 13, 2020 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants