Fix panel hide on escape with popup (#941)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2022-02-07 10:06:43 +01:00
committed by GitHub
parent 36a1b4d157
commit fa171012d5
@@ -18,6 +18,7 @@
import { afterUpdate } from 'svelte'
import { Spinner } from '..'
import { closePanel, PanelProps, panelstore as modal } from '../panelup'
import { popupstore } from '../popups'
let modalHTML: HTMLElement
let componentInstance: any
@@ -31,6 +32,11 @@
$: props = $modal.panel
function escapeClose () {
// Check if there is popup visible, then ignore
if ($popupstore.length > 0) {
return
}
if (componentInstance && componentInstance.canClose) {
if (!componentInstance.canClose()) return
}