From 6337e4d769354b9b31538f3b29b978fd6ef9638e Mon Sep 17 00:00:00 2001 From: "Milos Brzakovic (E-Search)" Date: Thu, 2 Dec 2021 16:31:41 +0100 Subject: [PATCH] aria-pressed on modes/notes tablist/tab on raw_tag --- modules/ui/geolocate.js | 4 ++-- modules/ui/sections/raw_tag_editor.js | 4 +++- modules/ui/tools/modes.js | 2 +- modules/ui/tools/notes.js | 4 +++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/ui/geolocate.js b/modules/ui/geolocate.js index e65ea201b..21e4c201a 100644 --- a/modules/ui/geolocate.js +++ b/modules/ui/geolocate.js @@ -77,7 +77,7 @@ export function uiGeolocate(context) { function updateButtonState() { _button.classed('active', _layer.enabled()); - _button.attr('aria-selected', _layer.enabled()); + _button.attr('aria-pressed', _layer.enabled()); } return function(selection) { @@ -86,7 +86,7 @@ export function uiGeolocate(context) { _button = selection .append('button') .on('click', click) - .attr('aria-selected', false) + .attr('aria-pressed', 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 1a09f3f56..9409f6c1b 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -84,7 +84,8 @@ export function uiSectionRawTagEditor(id, context) { var optionsEnter = options.enter() .insert('div', ':first-child') - .attr('class', 'raw-tag-options'); + .attr('class', 'raw-tag-options') + .attr('role', 'tablist'); var optionEnter = optionsEnter.selectAll('.raw-tag-option') .data(availableViews, function(d) { return d.id; }) @@ -96,6 +97,7 @@ export function uiSectionRawTagEditor(id, context) { return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : ''); }) .attr('aria-selected', function(d) { return _tagView === d.id; }) + .attr('role', 'tab') .attr('title', function(d) { return t('icons.' + d.id); }) .on('click', function(d3_event, d) { _tagView = d.id; diff --git a/modules/ui/tools/modes.js b/modules/ui/tools/modes.js index 7267d24b8..66109c664 100644 --- a/modules/ui/tools/modes.js +++ b/modules/ui/tools/modes.js @@ -139,7 +139,7 @@ export function uiToolOldDrawModes(context) { .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; }) + .attr('aria-pressed', function(d) { return context.mode() && context.mode().button === d.button; }) .classed('active', function(d) { return context.mode() && context.mode().button === d.button; }); } }; diff --git a/modules/ui/tools/notes.js b/modules/ui/tools/notes.js index 6ba23b377..776ba8f0e 100644 --- a/modules/ui/tools/notes.js +++ b/modules/ui/tools/notes.js @@ -108,7 +108,9 @@ export function uiToolNotes(context) { buttons = buttons .merge(buttonsEnter) .classed('disabled', function(d) { return !enabled(d); }) - .classed('active', function(d) { return context.mode() && context.mode().button === d.button; }); + .attr('aria-disabled', function(d) { return !enabled(d); }) + .classed('active', function(d) { return context.mode() && context.mode().button === d.button; }) + .attr('aria-pressed', function(d) { return context.mode() && context.mode().button === d.button; }); } };