Skip to content

fix(label): add disabled class when form-check-inline and disabled#159

Merged
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:feature/disabled-form-check-inline
Sep 28, 2016
Merged

fix(label): add disabled class when form-check-inline and disabled#159
eddywashere merged 1 commit intoreactstrap:masterfrom
TheSharpieOne:feature/disabled-form-check-inline

Conversation

@TheSharpieOne
Copy link
Copy Markdown
Member

@TheSharpieOne TheSharpieOne commented Sep 27, 2016

Adds the disabled class when the label has both the inline and
check props. This is the way bootstrap disables inline radio
and checkboxes since there is no wrapping element.

I must have missed this use-case before when creating the forms and labels. The whole form-check classes are new to bootstrap 4.

Note: there is currently an open issue with bootstrap (twbs/bootstrap#20799) to correct the color of the disabled label's text (and to clarify how to denote disabled inline radio/checkboxes in the docs as it is not there, I had to infer it from the styles)

Adds the disabled class when the label has both the inline and
check props. This is the way bootstrap disables inline radio
and checkboxes since there is no wrapping element.
@eddywashere
Copy link
Copy Markdown
Member

Nice work getting that other issue into the alpha v4 release. lgtm!

Comment thread src/Label.js
tag: Tag,
check,
inline,
disabled,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should disabled be passed into the rendered component? I don't think so in this context, but it's usually something that would get passed through in something like an input.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging this as is, just curious about that

Copy link
Copy Markdown
Member Author

@TheSharpieOne TheSharpieOne Sep 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this use case, the disabled class is needed on the label. You'd end up passing it to both the label and the Input (the input uses it for the attribute). Most of the time, the label does not wrap the Input. When not inline, you pass disabled to the FormGroup and the Input.
The validation library I create does these thing for the developer using contexts.

@eddywashere eddywashere merged commit 312b29e into reactstrap:master Sep 28, 2016
@TheSharpieOne TheSharpieOne deleted the feature/disabled-form-check-inline branch September 28, 2016 04:21
@eddywashere
Copy link
Copy Markdown
Member

published in 3.3.1 💫

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.

2 participants