-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reorganise props of multiline and localized inputs and fields #389
Conversation
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.
Good idea, thanks for making the APIs consistent 👌
Something is weird with the visual diff in the multiline component |
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.
Looks like the MultilineTextField
has different default behaviour, as shown here
Yeah, the input/field is now closed by default instead of open by default. This was done to be able to have consistent prop names, as That's why they are all closed in VRT now. I found it slightly better to have the visual diff then to pass additional props. Now the VRTs show the minimal props again, otherwise they'd have to pass the optional prop on every test now.. TLDR: Let's accept the changes in Percy as they were made on purpose. |
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.
works for me
BREAKING: Changed APIs of LocalizedMultilineTextField, LocalizedTextField, MultilineTextField, LocalizedMultilineTextInput, LocalizedTextInput and MultilineTextInput
6688449
to
e36dd26
Compare
Unifies the APIs of multiline and localized inputs and fields.
Before
This is a list of prop-names each input is using. Notice that the respective field components use the same prop-names, and they have changed as well!
MultilineTextInput
LocalizedTextInput
LocalizedMultilineTextInput
isDefaultClosed
isMultilineDefaultExpanded
isDefaultExpanded
areLanguagesDefaultOpened
hideExpansionControls
hideLanguageControls
Now
MultilineTextInput
LocalizedTextInput
LocalizedMultilineTextInput
defaultExpandMultilineText
defaultExpandMultilineText
defaultExpandLanguages
defaultExpandLanguages
hideLanguageExpansionControls
hideLanguageExpansionControls
The same property renamings happened for
LocalizedMultilineTextField
,LocalizedTextField
andMultilineTextField
.Notice that
isDefaultClosed
was renamed todefaultExpandMultilineText
forMultilineTextInput
,MultilineTextField
,LocalizedMultilineTextInput
andLocalizedMultilineTextField
. This means the default has been flipped! You now need to providedefaultExpandMultilineText
in cases where you were not passingisDefaultClosed
to keep the same behaviour! It also means you can remove any places where you were passingisDefaultClosed={true}
as that is the default now.BREAKING
Changed APIs of
LocalizedMultilineTextField
,LocalizedTextField
,MultilineTextField
,LocalizedMultilineTextInput
,LocalizedTextInput
andMultilineTextInput
.Closes #313
Migration guide:
Flipped defaults
MultilineTextInput
andMultilineTextField
isDefaultClosed
was dropped. The multiline-text is now closed by default. PassdefaultExpandMultilineText
to keep the original behaviour.Simple renamings
LocalizedTextInput
andLocalizedTextField
isDefaultExpanded
todefaultExpandLanguages
hideExpansionControls
tohideLanguageExpansionControls
LocalizedMultilineTextInput
andLocalizedMultilineTextField
isDefaultExpanded
todefaultExpandLanguages
hideExpansionControls
tohideLanguageExpansionControls
isMultilineDefaultExpanded
todefaultExpandMultilineText