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

Add indeterminate attribute for checkboxes #68

Closed
wants to merge 1 commit into from
Closed

Conversation

dyerc
Copy link

@dyerc dyerc commented Aug 12, 2016

I couldn't see any other way of setting a checkbox to an indeterminate state, so I have effectively mirrored the way a checked state is set. It seems to work fine when tested with my app.

@process-bot
Copy link

Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@evancz
Copy link
Member

evancz commented Aug 13, 2016

Can you provide MDN or W3C docs about this?

@dyerc
Copy link
Author

dyerc commented Aug 13, 2016

It is mentioned here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

A check box. You must use the value attribute to define the value submitted by this item. Use the checked attribute to indicate whether this item is selected. You can also use the indeterminate attribute (which can only be set programmatically) to indicate that the checkbox is in an indeterminate state (on most platforms, this draws a horizontal line across the checkbox).

Is the way I implemented this the best way of setting the value 'programmatically'?

@evancz
Copy link
Member

evancz commented Aug 13, 2016

Not sure. Have you tested that your implementation works? Sometimes you need to use attribute instead of property to get things working on all browsers.

I'd like to add this to #53 which is tracking a bunch of changes so we can make a more coherent release.

@dyerc
Copy link
Author

dyerc commented Aug 13, 2016

I have just given this a test in Chrome, Safari and Firefox on Mac, and IE 11 and Chrome on Windows. It seems to work fine in all of them. Chrome and all Mac versions show a horizontal line through the box, and IE shows a smaller square within it.

@evancz
Copy link
Member

evancz commented Aug 29, 2016

Seems reasonable. Added to #53 so I can review all these changes in one big batch and get them released together.

@evancz evancz closed this Aug 29, 2016
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

Successfully merging this pull request may close these issues.

3 participants