Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow closing drawer by outside click after form submission #865

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ All notable changes to this project will be documented in this file. The format
current item's about page.
- Made links clickable in the description of objects, key results and goals.
- It is no longer possible to close open modals or drawers by clicking outside
them. This is meant to prevent accidental data loss in unsaved forms.
them. This is meant to prevent accidental data loss in unsaved forms. Drawers
can however still be closed by outside click after form submission.
- Items in the admin panel now links directly to each respective item about page
with the edit drawer opened.
- The currently active item tab is now kept when navigating between
Expand Down
7 changes: 7 additions & 0 deletions src/components/drawers/PagedDrawerWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
]"
@close="$emit('close')"
@hidden="reset"
@click-outside="clickOutside"
>
<template #header>
<span
Expand Down Expand Up @@ -105,6 +106,12 @@ export default {
this.skin = null;
this.pageIndex = 1;
},

clickOutside(e) {
if (this.isDone) {
this.$emit('close', e);
}
},
},
};
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/components/drawers/SliderContainer.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<transition name="fade" mode="out-in">
<div v-if="visible" class="overlay"></div>
<div v-if="visible" class="overlay" @click.self="$emit('click-outside')"></div>
</transition>
<transition name="slide" @after-leave="$emit('hidden')">
<aside v-if="visible" class="sliderContainer">
Expand Down