Skip to content

Commit

Permalink
aria-pressed on modes/notes tablist/tab on raw_tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrzakovic committed Dec 2, 2021
1 parent 8eba5db commit 6337e4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/ui/geolocate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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')
Expand Down
4 changes: 3 additions & 1 deletion modules/ui/sections/raw_tag_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/tools/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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; });
}
};
Expand Down
4 changes: 3 additions & 1 deletion modules/ui/tools/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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; });
}
};

Expand Down

0 comments on commit 6337e4d

Please sign in to comment.