mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
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:
parent
a7a257cdce
commit
52a10d3acd
5 changed files with 23 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue