$api?. => $api. when possible
Now that this stuff has all been cleaned up with useXContext functions
This commit is contained in:
@@ -142,7 +142,7 @@
|
||||
if (containers.size !== 1) return;
|
||||
if (contains(containers, target)) return;
|
||||
|
||||
$api?.close();
|
||||
$api.close();
|
||||
await tick();
|
||||
target?.focus();
|
||||
}
|
||||
@@ -154,7 +154,7 @@
|
||||
if (containers.size > 1) return; // 1 is myself, otherwise other elements in the Stack
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$api?.close();
|
||||
$api.close();
|
||||
}
|
||||
|
||||
let mounted = false;
|
||||
@@ -202,7 +202,7 @@
|
||||
entry.boundingClientRect.width === 0 &&
|
||||
entry.boundingClientRect.height === 0
|
||||
) {
|
||||
$api?.close();
|
||||
$api.close();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
if (event.target !== event.currentTarget) return;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$api?.close();
|
||||
$api.close();
|
||||
}
|
||||
$: propsWeControl = {
|
||||
id,
|
||||
@@ -16,5 +16,5 @@
|
||||
</script>
|
||||
|
||||
<div {...{ ...$$restProps, ...propsWeControl }} on:click={handleClick}>
|
||||
<slot open={$api?.dialogState === DialogStates.Open} />
|
||||
<slot open={$api.dialogState === DialogStates.Open} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user