diff --git a/modules/ui/disclosure.js b/modules/ui/disclosure.js index 1b8d2c524..ce9dd3bb7 100644 --- a/modules/ui/disclosure.js +++ b/modules/ui/disclosure.js @@ -47,6 +47,7 @@ export function uiDisclosure(context, key, expandedDefault) { hideToggle .on('click', toggle) .attr('title', t(`icons.${_expanded ? 'collapse' : 'expand'}`)) + .attr('aria-expanded', _expanded) .classed('expanded', _expanded); hideToggle.selectAll('.hide-toggle-text') @@ -85,6 +86,7 @@ export function uiDisclosure(context, key, expandedDefault) { hideToggle .classed('expanded', _expanded) + .attr('aria-expanded', _expanded) .attr('title', t(`icons.${_expanded ? 'collapse' : 'expand'}`)); hideToggle.selectAll('.hide-toggle-icon') diff --git a/modules/ui/geolocate.js b/modules/ui/geolocate.js index 26dc2b144..e65ea201b 100644 --- a/modules/ui/geolocate.js +++ b/modules/ui/geolocate.js @@ -77,6 +77,7 @@ export function uiGeolocate(context) { function updateButtonState() { _button.classed('active', _layer.enabled()); + _button.attr('aria-selected', _layer.enabled()); } return function(selection) { @@ -85,6 +86,7 @@ export function uiGeolocate(context) { _button = selection .append('button') .on('click', click) + .attr('aria-selected', false) .call(svgIcon('#iD-icon-geolocate', 'light')) .call(uiTooltip() .placement((localizer.textDirection() === 'rtl') ? 'right' : 'left') diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index 357eb3bee..1a09f3f56 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -95,13 +95,15 @@ export function uiSectionRawTagEditor(id, context) { .attr('class', function(d) { return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : ''); }) + .attr('aria-selected', function(d) { return _tagView === d.id; }) .attr('title', function(d) { return t('icons.' + d.id); }) .on('click', function(d3_event, d) { _tagView = d.id; prefs('raw-tag-editor-view', d.id); wrap.selectAll('.raw-tag-option') - .classed('selected', function(datum) { return datum === d; }); + .classed('selected', function(datum) { return datum === d; }) + .attr('aria-selected', function(datum) { return datum === d; }); wrap.selectAll('.tag-text') .classed('hide', (d.id !== 'text')) diff --git a/modules/ui/tools/modes.js b/modules/ui/tools/modes.js index bf75f6c9f..7267d24b8 100644 --- a/modules/ui/tools/modes.js +++ b/modules/ui/tools/modes.js @@ -137,7 +137,9 @@ export function uiToolOldDrawModes(context) { // update buttons = buttons .merge(buttonsEnter) + .attr('aria-disabled', function(d) { return !enabled(d); }) .classed('disabled', function(d) { return !enabled(d); }) + .attr('aria-selected', function(d) { return context.mode() && context.mode().button === d.button; }) .classed('active', function(d) { return context.mode() && context.mode().button === d.button; }); } };