Use local transitions in modal to avoid issues with component unmounting when navigating away

This commit is contained in:
Andrew Kingston 2021-05-07 13:13:24 +01:00
parent 5d4d3f1949
commit 8aaeac764b
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@
<Portal target=".modal-container"> <Portal target=".modal-container">
<div <div
class="spectrum-Underlay is-open" class="spectrum-Underlay is-open"
transition:fade={{ duration: 200 }} transition:fade|local={{ duration: 200 }}
on:mousedown|self={hide} on:mousedown|self={hide}
> >
<div class="modal-wrapper" on:mousedown|self={hide}> <div class="modal-wrapper" on:mousedown|self={hide}>
@ -57,7 +57,7 @@
<div <div
use:focusFirstInput use:focusFirstInput
class="spectrum-Modal is-open" class="spectrum-Modal is-open"
transition:fly={{ y: 30, duration: 200 }} transition:fly|local={{ y: 30, duration: 200 }}
> >
<slot /> <slot />
</div> </div>