-
-
Notifications
You must be signed in to change notification settings - Fork 78.8k
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
Docs: add indeterminate disabled checkbox example #36674
Conversation
@@ -102,7 +102,9 @@ | |||
// Indeterminate checkbox example in docs and StackBlitz | |||
document.querySelectorAll('.bd-example-indeterminate [type="checkbox"]') | |||
.forEach(checkbox => { | |||
checkbox.indeterminate = true | |||
if (checkbox.id.includes('Indeterminate')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way around would be to set checkbox.indeterminate = true
only to the first example in .bd-example-indeterminate
:
document.querySelectorAll('.bd-example-indeterminate')
.forEach(example => {
example.querySelector('[type="checkbox"]').indeterminate = true
})
IDK what's the preferred approach here.
Would we ever want to add a custom |
You mean in the library itself (by having let's say as an example an For the documentation I tried to avoid having an extra-class so that it is still understandable for the user (when copy/pasting or editing via StackBlitz) that the indeterminate state can only be set by JavaScript. |
That all sounds good. I appreciate the goal of keeping the source code lean for the end user. |
Based on the work of @louismaximepiton this PR proposes to add a "Disabled indeterminate checkbox" example in Forms > Check & radios > Disabled.
Live preview