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

Unresponsive checkboxes when wrapped in element #1529

Closed
cimm opened this issue Jun 19, 2020 · 2 comments
Closed

Unresponsive checkboxes when wrapped in element #1529

cimm opened this issue Jun 19, 2020 · 2 comments
Labels
lang/css Anything involving CSS

Comments

@cimm
Copy link

cimm commented Jun 19, 2020

Bug Report

Check boxes become unresponsive when wrapped in another HTML element. Some frameworks, like Rails, wrap the element in another HTML element when the form contains errors so they can be styled, this breaks the visibility of the checkbox.

Steps to reproduce

Wrap an element around the input element, shown here (modified the Fomantic example). Now click the checkbox with the mouse, nothing happens.

wrapped

Well, something does happen, the real checkbox does update but the pseudo element placed over it does not reflect the change.

Expected result

The pseudo element shows the correct state of the underlying checkbox.

Testcase

https://jsfiddle.net/3bgmc6ea/

Version

2.8.6

@cimm cimm added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Jun 19, 2020
@ko2in ko2in added lang/css Anything involving CSS and removed state/awaiting-investigation Anything which needs more investigation labels Jun 19, 2020
@ko2in
Copy link
Member

ko2in commented Jun 19, 2020

IMHO, it's not possible to support random HTML layouts. There can be many possible ways to render the input and label for individual implementations.

If you put the label element first or if you wrap those in separate HTML container or if you put the input inside the label, that would produce the same output too.

Since, you use the framework, you have to follow the framework UI flow.

Or you can add your customization in checkbox.less (https://github.com/fomantic/Fomantic-UI/blob/master/src/definitions/modules/checkbox.less) to override framework behavior's that suits for your implementation.

@ko2in ko2in removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Jun 19, 2020
@cimm
Copy link
Author

cimm commented Jun 19, 2020

@ko2in Yes, I suppose that's fair. Fomantic can't handle everything any random framework comes up with. Will have to write my own. Thank you for the pointers!

@cimm cimm closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS
Projects
None yet
Development

No branches or pull requests

2 participants