BottomSheet: fix click inner select trigger close
All checks were successful
/ depoly (push) Successful in 1m17s
All checks were successful
/ depoly (push) Successful in 1m17s
This commit is contained in:
parent
f15a52b3db
commit
f965bb4002
1 changed files with 6 additions and 6 deletions
|
@ -209,13 +209,13 @@ const BottomSheet: ParentComponent<BottomSheetProps> = (props) => {
|
||||||
const onDialogClick = (
|
const onDialogClick = (
|
||||||
event: MouseEvent & { currentTarget: HTMLDialogElement },
|
event: MouseEvent & { currentTarget: HTMLDialogElement },
|
||||||
) => {
|
) => {
|
||||||
|
if (event.target !== event.currentTarget) return;
|
||||||
const rect = event.currentTarget.getBoundingClientRect();
|
const rect = event.currentTarget.getBoundingClientRect();
|
||||||
const isInDialog =
|
const isNotInDialog = event.clientY < rect.top ||
|
||||||
rect.top <= event.clientY &&
|
event.clientY > (rect.bottom) ||
|
||||||
event.clientY <= rect.top + rect.height &&
|
event.clientX < rect.left ||
|
||||||
rect.left <= event.clientX &&
|
event.clientX > rect.right;
|
||||||
event.clientX <= rect.left + rect.width;
|
if (isNotInDialog) {
|
||||||
if (!isInDialog) {
|
|
||||||
props.onClose?.("backdrop");
|
props.onClose?.("backdrop");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue