1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Replace deprecated initEvent()

Replaced deprecated initEvent() with recommended event constructor, Event(), as per MDN web docs specification.
https://developer.mozilla.org/en-US/docs/Web/API/Event/initEvent#browser_compatibility
This commit is contained in:
Kasin Sparks 2024-01-19 17:45:42 -05:00
parent c03ffb12c2
commit a24b840153
No known key found for this signature in database
GPG key ID: 19285E59CC901A74
6 changed files with 6 additions and 13 deletions

View file

@ -190,8 +190,7 @@ function raiseEvent(name, key, keyCode) {
return;
}
const event = document.createEvent('Event');
event.initEvent(name, true, true);
const event = new Event(name, { bubbles: true, cancelable: true });
event.key = key;
event.keyCode = keyCode;
(document.activeElement || document.body).dispatchEvent(event);