-
Notifications
You must be signed in to change notification settings - Fork 42
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
Update icon placement in LabeledInput/LabeledTextarea #1544
Conversation
@@ -124,7 +114,7 @@ export const LabeledInput = React.forwardRef((props, ref) => { | |||
ref={ref} | |||
{...rest} | |||
/> | |||
{icon && iconDisplayStyle === 'inline' && ( | |||
{(svgIcon || (svgIcon !== null && status && !message)) && ( |
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.
nit: Since there are many if statements here, would be helpful if you add a comment.
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.
can also be moved to a variable for readability
const shouldShowIcon = svgIcon !== null && (svgIcon || (status && !message));
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.
Added fancy condition variable for readability
Changes
Removed iconDisplayStyle;
svgIcon is being rendered inline;
Users must use StatusMessage to add custom icon to the message;
Testing
Updated images for status input and textarea;
Docs
Changeset added;