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 custom checkboxes and radio buttons cursor looks clickable #21781

Closed
TheSharpieOne opened this issue Jan 19, 2017 · 14 comments
Closed
Labels

Comments

@TheSharpieOne
Copy link

  • Operating system and version: Mac OS X 10.11
  • Browser and version: Chrome 55, Firefox 50, Safari 10

Go to https://v4-alpha.getbootstrap.com/components/forms/#disabled hover over the disabled checkbox. Notice the cursor.

disabled-custom-checkbox-radio

History: #17918

@RusinovAnton
Copy link

FYI Pointer is not changing because of pointer-events: none property

@TheSharpieOne
Copy link
Author

TheSharpieOne commented Jan 19, 2017

Yes, but would the solution be to remove it from .custom-control-indicator (not sure why it was added there #18887) or to override it in .custom-control-input:disabled~.custom-control-indicator (such as setting it to inherit or back to auto)?

@RusinovAnton
Copy link

@TheSharpieOne seems like pointer-events: none makes no sense because it is still impossible to check disabled checkbox by clicking on .custom-control-indicator without it.

@TheSharpieOne
Copy link
Author

Fixing this causes the visual issue describe on #17918 (comment)

It is a shame the cursor:not-allowed; is applied separately to the element and the label, and not the entire hitbox (e.g. there is a gap between the element and label where the normal cursor is shown). This is again a consequence of not being able to style the parent control (the form-group div) based on the child's state. (Without non-trivial changes to the html.)

Which really begs the question, why is this different than other checkboxes and radios when it is disabled. The regular checkboxes and radios have .disable on a parent element and that is fine, but here it is considered as "non-trivial changes to the html"

@RusinovAnton
Copy link

@TheSharpieOne but look, when I want to control disabled attribute for my checkbox with Javascript I'd rather add it for input itself than adding .disable on a parent element.

@TheSharpieOne
Copy link
Author

@RusinovAnton Same, but that is not how the standard controls work. Consistency is king.

@CyrilWork
Copy link

noob question: Is there a selector to select parent node ?

like input[disabled] < label

@TheSharpieOne
Copy link
Author

That question would probably be best for stackoverflow.... but...
CSS4 has $ (not sure what the actual feature is called) which allows you to apply the styles to parent elements. such as $label > input[disabled] would apply the styles to a label which has a direct child of input[disabled]

@mdo mdo modified the milestone: v4.0.0-beta.2 Jan 21, 2017
@mdo mdo modified the milestones: v4.0.0-beta, v4.0.0-beta.2 Jan 24, 2017
@RusinovAnton
Copy link

@mdo how that #21812 fixes this issue? I've just tested and the problem is still present.

@patrickhlauke
Copy link
Member

patrickhlauke commented Jan 24, 2017

Reopening because although the mouse cursor now doesn't change to the hand / cursor:pointer (following #21812), it's still true that the cursor: not-allowed isn't shown when on the control itself

@patrickhlauke patrickhlauke reopened this Jan 24, 2017
@mdo
Copy link
Member

mdo commented Jan 24, 2017

Doh, you're right. Thanks for commenting @RusinovAnton and reopening @patrickhlauke.

@mdo
Copy link
Member

mdo commented Mar 20, 2017

This is caused by the pointer-events: none added in #18935. Unsure how best to proceed if we have that; there's no option of setting a cursor unless we remove it.

@mdo mdo removed this from the v4.0.0-beta milestone Mar 20, 2017
@mdo mdo modified the milestone: v4.0.0-beta.2 Apr 22, 2017
@mdo mdo added this to Misc in v4 Beta 2 May 26, 2017
@chiraggmodi
Copy link
Contributor

what if we add pointer-events:auto to class .custom-control-input:disabled ~ .custom-control-indicator

@mdo mdo removed this from the v4.0.0-beta.2 milestone Jun 18, 2017
@mdo
Copy link
Member

mdo commented Jul 2, 2017

This looks fine in Safari 10 now. Closing out.

@mdo mdo closed this as completed Jul 2, 2017
@mdo mdo removed this from Inbox in v4 Beta 2 Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants