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

Visualize Accessibility Issues #13428

Merged
merged 6 commits into from
Aug 10, 2017

Conversation

thomasneirynck
Copy link
Contributor

@thomasneirynck thomasneirynck commented Aug 9, 2017

Follow up on #13226.

Closes #12896
Closes #12897
Closes #12898
Closes #12899

@thomasneirynck thomasneirynck added Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix v6.0.0 v7.0.0 labels Aug 9, 2017
@thomasneirynck
Copy link
Contributor Author

cc @aphelionz @timroes

@@ -85,11 +85,13 @@ class MetricPanelConfig extends Component {
<div
className={`kbnTabs__tab${selectedTab === 'data' && '-active' || ''}`}
onClick={() => this.switchTab('data')}
tabIndex="0"
Copy link
Contributor

Choose a reason for hiding this comment

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

The value is all lowercase tabindex.

Copy link
Contributor

Choose a reason for hiding this comment

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

Forget this, I haven't noticed, this was a React component.

Legend Position
</label>
<select
aria-labelledby="visualizeBasicSettingsLegendPosition"
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, I would prefer giving the select an id and the label a for attribute with that value.

That way all users would benefit, since the label is also outside the accessibility (i.e. in the regular DOM) linked to the select box, and you can e.g. click on the label to jump to the input (not working for select, but that's another topic).

class="form-control"
ng-model="vis.params.legendPosition"
ng-options="position.value as position.text for position in vis.type.editorConfig.collections.legendPositions"
>
</select>
</div>
<div class="vis-option-item">
<label>
<input type="checkbox" ng-model="vis.params.addTooltip">
<label id="visualizeBasicSettingsShowTooltip">
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need this at all. Since the input is already inside the label they are correctly linked, and you wouldn't need to link them specially for screen readers.

<label>Per Page</label>
<input type="number" ng-model="vis.params.perPage" class="form-control">
<label id="datatableVisualizationPerPage">Per Page</label>
<input type="number" ng-model="vis.params.perPage" class="form-control" for="datatableVisualizationPerPage">
Copy link
Contributor

Choose a reason for hiding this comment

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

id and for are interchanged. The label is for a specific input (specified by its id).

<select ng-disabled="!vis.params.showTotal"
class="form-control"
ng-model="vis.params.totalFunc"
ng-options="x for x in totalAggregations">
ng-options="x for x in totalAggregations" for="datatableVisualizationTotalFunction">
Copy link
Contributor

Choose a reason for hiding this comment

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

id <-> for

@@ -1,7 +1,9 @@
<!-- vis type specific options -->
<div class="form-group">
<label>Map type</label>
<select name="agg"
<label id="coordinateMapOptionsMapType">Map type</label>
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use <label for> here too instead of aria-labelledby

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason, you left this with aria-labelledby instead of label for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my mistake, an oversight on my part, changed this now.

@@ -5,6 +5,7 @@
ng-class="{ 'timelion-interval-custom-compact': interval === 'other' }"
ng-model="otherInterval"
><select
aria-labelledby="timelionInterval"
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use for on the label instead. Which is imho also a little nicer in case of what the directive relies on. The aria-labelledby way the directive relies on being used in a context where a label with that given id exists. If you use for the directive just renders something with an id and the place where it is used utilize that id for its label.

Also I think this directive is used inside of timelion where there isn't a label currently. Since we still might want to use that directive in both places and make it accessible in both places, in this case we might be better adding an aria-label to it, that holds the label directly, without requiring the user of the directive to label it correctly.

@thomasneirynck
Copy link
Contributor Author

thanks @timroes, pushed changes, 2nd look?

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

LGTM

@thomasneirynck thomasneirynck merged commit f1e5be8 into elastic:master Aug 10, 2017
thomasneirynck added a commit that referenced this pull request Aug 10, 2017
thomasneirynck added a commit to thomasneirynck/kibana that referenced this pull request Aug 10, 2017
Backport. Required a couple of manual edits
@thomasneirynck
Copy link
Contributor Author

Backports:
6.x: 4a47c03
6.0: #13447

thomasneirynck added a commit that referenced this pull request Aug 10, 2017
Backport. Required a couple of manual edits
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Nov 20, 2017
chrisronline pushed a commit to chrisronline/kibana that referenced this pull request Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:fix review v6.0.0-rc1 v6.0.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants