-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Management] Improve accessibility within management #13364
[Management] Improve accessibility within management #13364
Conversation
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.
Added some comments.
I moved the info icon in #13341. I moved it to the status page as suggested in the ticket, so I think we should also leave that PR open. But I guess we can merge yours and mine in the end without any problem.
<span ng-if="!sectionName" class="kuiLocalTab"> | ||
{{::section.display}} | ||
</span> | ||
<header ng-if="!sectionName" id="tabHeader" tabindex="0"> |
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.
As discussed (unfortunately after you already did this) in #12861 I don't see a reason, why we would add an id
and tabindex
here. That element is not interactive at all, why would we need to focus it?
I think it might have been confusing, since that title also has a cursor: pointer
and hover color when using the mouse (but still no interactive content).
I would really appreciate @aphelionz feedback on this, but I think we should remove id
and tabindex
here and most likely also remove the pointer cursor and hover color?
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.
I agree about the cursor: pointer and hover color here if it's not interactive. However I can go either way on it being tabbable based on the idea that I expressed in the other issue - orienting the user on the page and audibly saying the name of the section.
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.
I would then leave it like that. So just ignore that comment :-)
@@ -3,6 +3,7 @@ | |||
data-test-subj="indexPatternFieldEditButton" | |||
ng-href="{{ kbnUrl.getRouteHref(field, 'edit') }}" | |||
aria-label="Edit" | |||
tabindex="0" |
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.
a
element with an href
(or in this case ng-href
) are automatically in taborder. This attribute isn't needed.
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.
Okay good to know!
@@ -12,6 +13,7 @@ | |||
ng-if="field.scripted" | |||
ng-click="remove(field)" | |||
class="kuiButton kuiButton--danger kuiButton--small" | |||
tabindex="0" |
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.
button
s are automatically in taboder and this attribute can safely be removed.
@@ -73,6 +73,7 @@ <h1 class="kuiTitle"> | |||
class="kuiToolBarSearchBox__input" | |||
type="text" | |||
placeholder="Search..." | |||
role="search" |
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.
role=search
should be on a parent diff, see my comments here
@@ -15,6 +15,7 @@ | |||
<kbn-info ng-if="col.info" info="{{ col.info }}" placement="top"></kbn-info> | |||
<i | |||
ng-if="col.sortable !== false" | |||
tabindex="0" |
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.
tabindex
needs to be on the element, that also allows the click (ng-click
). Also this only makes it focusable, but not "keyboard accessible", that the user can activate the action by keyboard. You would need to add the kbnAccessibleClick
directive too.
Resolved those issues @timroes. Appreciate the deep dive! |
<header ng-if="!sectionName" id="tabHeader" tabindex="0"> | ||
<h2 class="kuiLocalTab"> | ||
<header ng-if="!sectionName" id="tabHeader"> | ||
<h2> |
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.
We should keep the class kuiLocalTab
here. I think @timroes's comment was about removing the id
and tabindex
attributes. But I think we may actually want to revert this commit until @aphelionz has had a chance to explain how these attributes affect accessibility, since he's the one who established this pattern originally.
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.
Also, as a general rule of thumb, we should avoid removing classes that affect the UI unless we're confident that this is a good change. In this case, this is a bad change because it introduces inconsistency between the headers of the different apps. Feel free to ping members of the design team with questions about this kind of stuff in the future.
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.
Thanks for the heads up @cjcenizal! I'll revert this back, or possibly introduce a new class that has the same styles sans the hover treatment.
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.
Revert done. Will wait until we hear from @aphelionz!
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.
This tab should have the .kuiLocalTab-isSelected
class applied to it, which should do the trick.
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.
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.
Ah, I know what's wrong. We need to add margin: 0
to the kuiLocalTab class in the UI Framework. The <h2>
elements introduces a margin, and this component's design doesn't anticipate this kind of use case.
Thanks for pinging me on this, @chrisronline! I'll wait until #13341 is merged and rebased onto this branch before I review, since that will simplify the diff. |
@timroes It looks like @aphelionz explained his reasoning in #12861 (comment):
Seems to make sense to me. Thoughts? |
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.
I think we might want to revisit the kuiLocalTab directive based on @timroes' feedback. There might be too much built in to one class declaration for a11y purposes
<span ng-if="!sectionName" class="kuiLocalTab"> | ||
{{::section.display}} | ||
</span> | ||
<header ng-if="!sectionName" id="tabHeader" tabindex="0"> |
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.
I agree about the cursor: pointer and hover color here if it's not interactive. However I can go either way on it being tabbable based on the idea that I expressed in the other issue - orienting the user on the page and audibly saying the name of the section.
FYI: #13341 is merged. Could you maybe rebase to master again? |
<input | ||
ng-model="editor.field.name" | ||
id="scriptedFieldName00------------" |
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.
Btw, I forgot to add that comment yesterday: What has happened to this id
? 🐱 ⌨️
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.
That'd be my cat :) Thanks for pointing it out!
If you could still rebase it, fix the broken ID, I would be fine to give this a LGTM. I think we should move the discussion about |
…stly, we can probably make due without any class (using default h2 styles)
…s - honestly, we can probably make due without any class (using default h2 styles)" This reverts commit c54ea227889898baef85ee71b3350bbf69ef5d7c.
428017d
to
124c3af
Compare
@timroes Sounds good. Should I remove all changes in regards to header, or leave what I have? |
I would leave it like it is currently. |
@timroes Great! PR has been rebased and ready for the last pass! |
LGTM. I think we should think about the focus color/shadow in tables header, they look weird (in Chrome), but wouldn't consider this to be part of this PR. |
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.
🎉 Fantastic! I had a couple minor comments.
To fully address #12863, we also need to make sure we address the different parts of the form that become available when you choose different "Format" values:
We also need to address the "Create Index Pattern" form for this issue, but we can do that as part of #13154. I left a comment on that PR.
<h2 class="kuiLocalTab"> | ||
{{::section.display}} | ||
</h2> | ||
</header> |
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.
Minor nit, but I think the original issue had a slight error in that it referred to a "header", but really meant to refer to a "heading". So I think this markup should become this:
<h2 class="kuiLocalTab" ng-if="!sectionName" id="tabHeader" tabindex="0">
{{::section.display}}
</h2>
@@ -10,6 +10,8 @@ | |||
<th | |||
ng-repeat="col in columns" | |||
ng-click="paginatedTable.sortColumn($index)" | |||
kbn-accessible-click | |||
tabindex="0" |
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.
Awesome! @snide do you think you could fix the focus styles for these elements?
@cjcenizal Great call out! Fixed and ready for another pass! |
@@ -1,5 +1,6 @@ | |||
<div class="form-group"> | |||
<input | |||
id="{{ id }}" |
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.
Is there any requirement for a label here?
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.
It corresponds to labels used outside of the directive: https://github.com/elastic/kibana/pull/13364/files#diff-cdc9adaaaf6e3096b1edb04fc611d045
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.
Gotcha 👍
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.
Nice! Had one minor concern.
// The id attribute is not always an angular expression but nearly always | ||
// just a string passed in | ||
$scope.id = attrs.id; | ||
attrs.$observe('id', () => $scope.id = attrs.id); |
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.
I think this directive needs replace: true
, or else the directive shows up as a DOM element with an id
on it, which I think will take precedence over the input's id
.
Also, I think you can define this a little more simply via the scope
property:
scope: {
id: '@',
},
Did you already give that a shot?
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.
You might also want to double check my assertion about the id
in the browser.
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.
You're absolutely right. Good call out
Fixed up @cjcenizal. Ready for another pass! |
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.
LGTM!
* Use header/h tag for tab header, #12861 * Add tabindexes for tables, #12862 * Add for/id pairings, #12863 * Search role, #12868 * Use better descriptions for aria labels, #12865 * Add aria label, #12870 * Button and a tags are already in tab order, removing unnecessary change * The input field cannot contain the role="search" * The tabindex needs to be on the element which the click handler * Remove tabindex and remove the class applying the hover styles - honestly, we can probably make due without any class (using default h2 styles) * Revert "Remove tabindex and remove the class applying the hover styles - honestly, we can probably make due without any class (using default h2 styles)" This reverts commit c54ea227889898baef85ee71b3350bbf69ef5d7c. * Remove the extra code my cat added * Addressing hidden inputs from #12863 * Remove unnecessary header tag * Add clarifying comment * Prevent multiple ids
* Use header/h tag for tab header, #12861 * Add tabindexes for tables, #12862 * Add for/id pairings, #12863 * Search role, #12868 * Use better descriptions for aria labels, #12865 * Add aria label, #12870 * Button and a tags are already in tab order, removing unnecessary change * The input field cannot contain the role="search" * The tabindex needs to be on the element which the click handler * Remove tabindex and remove the class applying the hover styles - honestly, we can probably make due without any class (using default h2 styles) * Revert "Remove tabindex and remove the class applying the hover styles - honestly, we can probably make due without any class (using default h2 styles)" This reverts commit c54ea227889898baef85ee71b3350bbf69ef5d7c. * Remove the extra code my cat added * Addressing hidden inputs from #12863 * Remove unnecessary header tag * Add clarifying comment * Prevent multiple ids
Closes #12861
Closes #12862
Closes #12863
Closes #12865
Closes #12868
Closes #12870
Closes #11526
This PR addresses some low hanging fruit to improve accessibility within the management area.