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

disabled button 中的 cursor: not-allowed 沒有作用 #950

Closed
jimchen5209 opened this issue Nov 23, 2023 · 1 comment
Closed

disabled button 中的 cursor: not-allowed 沒有作用 #950

jimchen5209 opened this issue Nov 23, 2023 · 1 comment
Assignees
Labels
🐛 已證實 Bug 非常確定是個 Bug。 🎨 CSS 與 CSS 和外觀設計上有關聯。
Milestone

Comments

@jimchen5209
Copy link

問題描述

發現在 .ts-button.is-disabled 的按鈕中,設定了 cursor: not-allowed; 屬性,但是滑鼠游標指上去時沒有正確顯示無法使用的符號

初步 debug 發現似乎是因為 pointer-events: none; 把這個事件吃掉了,導致游標沒有正確變過去,目前實測移除此屬性後游標有正確變過去,但是不確定會不會有什麼反效果

實測網站

https://v4.tocas-ui.com/zh-tw/button.html#disabled

預期結果

image

實際結果

image

其他資訊

類似 issue 參考: twbs/bootstrap#16088

測試過的瀏覽器:

  • Edge 119.0.2151.72
  • Chrome 119.0.6045.160
  • Firefox 120.0
@YamiOdymel
Copy link
Member

真正的作法是把 cursor: not-allowed; 移除掉,畢竟那只是裝飾點綴的不太重要,
保留 pointer-events: none; 才能確保使用者不會誤觸這個按鈕。

但其實這樣也不太對,因為 is-disabled 的東西
其實還是可以靠鍵盤的 Tab 來切換焦點而獲得點擊、改變(如果是 .ts-input.is-disabled)的話。

為了避免有人只用 is-disabled 卻沒有在輸入欄位加上 [disabled] 的標籤,額外建立新的 Issue #960

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 已證實 Bug 非常確定是個 Bug。 🎨 CSS 與 CSS 和外觀設計上有關聯。
Projects
None yet
Development

No branches or pull requests

2 participants