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

Allow form row labels to be optional #260

Merged
merged 1 commit into from
Jul 11, 2017

Conversation

tlconnor
Copy link
Contributor

@tlconnor tlconnor commented Jul 11, 2017

This PR allows users to pass label={false} to FormRow components, preventing the component from rendering a label.

This is useful for inputs within tables where the table header is used instead of a label.

For example in the screenshot below the Account column uses FormRow to make use of the field level error handling but does not need a label for each input.
screen shot 2017-07-11 at 12 22 01 pm

{label}
{required && label ? <span className="text-danger">&nbsp;*</span> : null}
</Label>
{label !== false && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, would this be better to just not display if no label? E.g. {label &&

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, fixed.

@tlconnor tlconnor force-pushed the optional-form-row-label branch from 6abe45b to 07022a2 Compare July 11, 2017 20:31
@gthomas-appfolio gthomas-appfolio merged commit b4bd38f into master Jul 11, 2017
@gthomas-appfolio
Copy link
Contributor

👍

@gthomas-appfolio gthomas-appfolio deleted the optional-form-row-label branch July 11, 2017 21:36
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