fix(modal): prevent clicking inside inner modal from closing the modal

- revert adding a `stopPropagation` modifier to the PasswordInput "toggle password" button
This commit is contained in:
Eric Liu 2020-08-12 12:46:07 -07:00
commit 52a10d3acd
5 changed files with 23 additions and 12 deletions

View file

@ -110,6 +110,7 @@
let buttonRef = null;
let innerModal = null;
let opened = false;
let didClickInnerModal = false;
function focus(element) {
const node =
@ -165,10 +166,9 @@
}
}}
on:click
on:click={({ target }) => {
if (!innerModal.contains(target)) {
open = false;
}
on:click={() => {
if (!didClickInnerModal) open = false;
didClickInnerModal = false;
}}
on:mouseover
on:mouseenter
@ -179,7 +179,10 @@
aria-modal="true"
aria-label={ariaLabel}
class:bx--modal-container={true}
class={size && `bx--modal-container--${size}`}>
class={size && `bx--modal-container--${size}`}
on:click={() => {
didClickInnerModal = true;
}}>
<div class:bx--modal-header={true}>
{#if passiveModal}
<button