fixes in dialogs

This commit is contained in:
InsanusMokrassar 2023-01-23 12:50:50 +06:00
parent ce5281c52d
commit 264bcae65e

View File

@ -54,6 +54,8 @@ fun Dialog(
if (onHidden != null || removeOnHide) { if (onHidden != null || removeOnHide) {
htmlElement.addEventListener("hidden", { htmlElement.addEventListener("hidden", {
if (it.target != htmlElement) return@addEventListener
onHidden ?.invoke(htmlElement) onHidden ?.invoke(htmlElement)
if (removeOnHide) { if (removeOnHide) {
@ -64,6 +66,8 @@ fun Dialog(
onShown ?.let { onShown ?.let {
htmlElement.addEventListener("shown", { htmlElement.addEventListener("shown", {
if (it.target != htmlElement) return@addEventListener
onShown(htmlElement) onShown(htmlElement)
}) })
} }