Don't write directly to classList in FocusTrap.js

According to [MDN][1] `classList` is a read-only property. To properly write to it you use its [`value`][2] property (`DOMTokenList#value`) 

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
[2]: https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/value
pull/4016/head
Bartosz Gościński 2023-06-02 14:53:42 +02:00 committed by GitHub
parent bf653e0c7d
commit 7249a732c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ function createHiddenFocusableElements(el, binding) {
const createFocusableElement = (onFocus) => {
const element = document.createElement('span');
element.classList = 'p-hidden-accessible p-hidden-focusable';
element.classList.value = 'p-hidden-accessible p-hidden-focusable';
element.tabIndex = tabIndex;
element.setAttribute('aria-hidden', 'true');
element.setAttribute('role', 'presentation');