chore: reactive hiding body scroll on modal

This commit is contained in:
2024-05-25 17:05:41 +02:00
parent 17d77a80d8
commit bcb9c63cb0
2 changed files with 7 additions and 7 deletions
+7
View File
@@ -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);
}
});
}