mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
Fix accessibility (a11y) on swal2 modals (#986)
* Remove tabindex on bootstrap modals if swal open * fix linting
This commit is contained in:
@@ -195,6 +195,11 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
||||
}
|
||||
}
|
||||
|
||||
const bootstrapModal = document.querySelector('div.modal');
|
||||
if (bootstrapModal != null) {
|
||||
bootstrapModal.removeAttribute('tabindex');
|
||||
}
|
||||
|
||||
const iconHtmlStr = iconClasses != null ? `<i class="swal-custom-icon fa ${iconClasses}"></i>` : undefined;
|
||||
const confirmed = await Swal.fire({
|
||||
heightAuto: false,
|
||||
@@ -210,6 +215,10 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
||||
confirmButtonText: confirmText == null ? this.i18nService.t('ok') : confirmText,
|
||||
});
|
||||
|
||||
if (bootstrapModal != null) {
|
||||
bootstrapModal.setAttribute('tabindex', '-1');
|
||||
}
|
||||
|
||||
return confirmed.value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user