Skip to content

Commit

Permalink
[Accessibility] A <label> for time bucket size selector on discover (#…
Browse files Browse the repository at this point in the history
…38396)

* Replace <span> with a <label for=''> used as a label for a dropdown <select>
* Change CSS selector for functional test
  • Loading branch information
PhilippBaranovskiy authored Jun 12, 2019
1 parent f877c78 commit 7225591
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/legacy/core_plugins/kibana/public/discover/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,18 @@ <h1 id="kui_local_breadcrumb" class="kuiLocalBreadcrumb" ng-if="opts.savedSearch
>
<header class="dscTimechart__header">
<div class="small">
<span
<label
for="dscResultsIntervalSelector"
tooltip="{{::'kbn.discover.howToChangeTheTimeTooltip' | i18n: {defaultMessage: 'To change the time, click the clock icon in the navigation bar'} }}"
>
{{toMoment(timeRange.from)}} - {{toMoment(timeRange.to)}}
</span>
</label>

&mdash;

<span class="form-inline">
<select
id="dscResultsIntervalSelector"
class="dscResults__interval form-control"
ng-model="state.interval"
ng-options="interval.val as interval.display for interval in intervalOptions | filter: intervalEnabled"
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
}

async getChartTimespan() {
const el = await find.byCssSelector('.small > span:nth-child(1)');
const el = await find.byCssSelector('.small > label[for="dscResultsIntervalSelector"]');
return await el.getVisibleText();
}

Expand Down

0 comments on commit 7225591

Please sign in to comment.