Revert removal of label text inference and allow nil#1047
Merged
paulcsmith merged 2 commits intomasterfrom Mar 14, 2020
Merged
Conversation
This reverts commit b41fe3c.
#1028 (comment) > Actually I may have overthought this. Lucky wants to avoid bugs, but also be practical. Sometimes nils can sneak in when you don't expect it...but maybe label_text is not one of those places. I have a hard time seeing a use case where someone is conditionally generating a label and it might accidentally be nil. I think of all the apps I've ever written I've never accidentally set label text to nil. > So I think what I'll do is make the label text String?. So that if you pass nil to text it will infer the label name like it does now when you leave the arg off completely. That way we can still keep the component flexible by allowing String? but we also keep label_for flexible. I'll go ahead and make that change now. This also means existing apps will still work when you upgrade and this will no longer be a breaking change 👍
aa3ad63 to
4eed5cd
Compare
Member
Author
|
Thanks for your feedback on the issue @wontruefree. I think this should be more flexible than my previous solution and will make writing Field components a lot simpler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1028 (comment)