mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-31 09:52:24 +00:00
Improve video modal accessibility handling
This commit is contained in:
1 parent
eef0a50f24
commit
16cb69021d
6 files changed
+228
-26
No files matched your search
@@ -461,7 +461,7 @@ export class VideoModal {
|
||||
this.dispatch("creator:navigate", { video: this.activeVideo });
|
||||
}
|
||||
|
||||
open(video) {
|
||||
open(video, options = {}) {
|
||||
this.activeVideo = video || null;
|
||||
if (!this.playerModal) {
|
||||
return;
|
||||
@@ -471,7 +471,9 @@ export class VideoModal {
|
||||
this.playerModal.classList.remove("hidden");
|
||||
this.document.body.classList.add("modal-open");
|
||||
this.document.documentElement.classList.add("modal-open");
|
||||
this.modalAccessibility?.activate();
|
||||
const triggerElement =
|
||||
options && typeof options === "object" ? options.triggerElement : null;
|
||||
this.modalAccessibility?.activate({ triggerElement });
|
||||
if (this.scrollRegion) {
|
||||
this.scrollRegion.scrollTop = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user