fix: prevent closing the selector when clicking title and search box

This commit is contained in:
chenyu 2024-12-29 11:05:07 +08:00
parent 8cfa534053
commit 8fab48b6f8

View File

@ -523,8 +523,11 @@ export function Selector<T>(props: {
}
return (
<div className={styles["selector"]} onClick={() => props.onClose?.()}>
<div className={styles["selector-content"]}>
{/* todo: add searchbox */}
<div
className={styles["selector-content"]}
onClick={(e) => e.stopPropagation()}
>
{/* title and search box */}
<div className={styles["selector-bar"]}>
<div className={styles["selector-title"]}>
{Locale.UI.SelectorTitle}
@ -539,6 +542,7 @@ export function Selector<T>(props: {
/>
</div>
</div>
{/* list content */}
<List>
{filteredItems.length ? (
filteredItems.map((item, i) => {