mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
chore: reactive hiding body scroll on modal
This commit is contained in:
@@ -29,8 +29,15 @@ export default defineComponent({
|
||||
chosenTrain(train: Train | undefined) {
|
||||
this.$nextTick(() => {
|
||||
if (train) {
|
||||
document.body.classList.add('no-scroll');
|
||||
const contentEl = this.$refs['content'] as HTMLElement;
|
||||
contentEl.focus();
|
||||
} else {
|
||||
(this.store.modalLastClickedTarget as any)?.focus();
|
||||
|
||||
setTimeout(() => {
|
||||
document.body.classList.remove('no-scroll');
|
||||
}, 90);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user