Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

彈出式選單希望可以有方法在重複點擊時保持開啟 #1063

Open
itshenrywu opened this issue Nov 14, 2024 · 0 comments
Open

彈出式選單希望可以有方法在重複點擊時保持開啟 #1063

itshenrywu opened this issue Nov 14, 2024 · 0 comments

Comments

@itshenrywu
Copy link
Member

<input> 輸入框上使用時,如果重複點擊,彈出式選單就會被一直關閉、開啟,感覺會有點怪

如果可以加入 data-autoclose 之類的 key,就可以判斷點擊時的動作

// 切換目標彈出式選單的可見度。
if (element.dataset.autoclose === "false") {
    target.classList.add("is-visible")
} else {
    target.classList.toggle("is-visible")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant