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

Update icon placement in LabeledInput/LabeledTextarea #1544

Merged
merged 6 commits into from Sep 6, 2023

Conversation

gretanausedaite
Copy link
Contributor

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;

@gretanausedaite gretanausedaite requested review from a team as code owners September 4, 2023 10:08
@gretanausedaite gretanausedaite requested review from mayank99 and rohan-kadkol and removed request for a team September 4, 2023 10:08
@gretanausedaite gretanausedaite self-assigned this Sep 4, 2023
@gretanausedaite gretanausedaite added this to the React 3.0 milestone Sep 4, 2023
@@ -124,7 +114,7 @@ export const LabeledInput = React.forwardRef((props, ref) => {
ref={ref}
{...rest}
/>
{icon && iconDisplayStyle === 'inline' && (
{(svgIcon || (svgIcon !== null && status && !message)) && (
Copy link
Member

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.

Copy link
Contributor

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));

Copy link
Contributor Author

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

@gretanausedaite gretanausedaite merged commit f900316 into dev Sep 6, 2023
15 of 16 checks passed
@gretanausedaite gretanausedaite deleted the greta/fix-input-icon branch September 6, 2023 08:25
@imodeljs-admin imodeljs-admin mentioned this pull request Oct 23, 2023
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.

None yet

3 participants