Skip to content

Commit 8fde5b8

Browse files
committed
Fix accessibility of buttons in the external storage configuration
This means adding the button role and a tabindex attribute, it also tries to handle the expanded state for the advanced options dropdown. Note, however, that there is no keyboard only way how to close the dropdown.
1 parent 4c3dad6 commit 8fde5b8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

apps/files_external/js/settings.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ MountConfigListView.prototype = _.extend({
715715
});
716716

717717
this.$el.on('click', 'td.mountOptionsToggle>.icon-more', function() {
718+
$(this).attr('aria-expanded', 'true');
718719
self._showMountOptionsDropdown($(this).closest('tr'));
719720
});
720721

@@ -1343,6 +1344,7 @@ MountConfigListView.prototype = _.extend({
13431344
var mountOptions = dropDown.getOptions();
13441345
$('body').off('mouseup.mountOptionsDropdown');
13451346
$tr.find('input.mountOptions').val(JSON.stringify(mountOptions));
1347+
$tr.find('td.mountOptionsToggle>.icon-more').attr('aria-expanded', 'false');
13461348
self.saveStorageConfig($tr);
13471349
});
13481350
}

apps/files_external/templates/settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ function writeParameterInput($parameter, $options, $classes = []) {
173173
</td>
174174
<?php endif; ?>
175175
<td class="mountOptionsToggle hidden">
176-
<div class="icon-more" title="<?php p($l->t('Advanced settings')); ?>"></div>
176+
<div class="icon-more" title="<?php p($l->t('Advanced settings')); ?>" role="button" tabindex=0 aria-expanded=false></div>
177177
<input type="hidden" class="mountOptions" value="" />
178178
</td>
179179
<td class="save hidden">
180-
<div class="icon-checkmark" title="<?php p($l->t('Save')); ?>"></div>
180+
<div class="icon-checkmark" title="<?php p($l->t('Save')); ?>" role="button" tabindex=0></div>
181181
</td>
182182
</tr>
183183
</tbody>

0 commit comments

Comments
 (0)