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

Make selectors feel more at home #3750

Merged

Conversation

ivarnakken
Copy link
Member

@ivarnakken ivarnakken commented Apr 6, 2023

Description

They now share the styling of all the other input fields in all ways. This makes them feel much more at home, and they no longer stick out much.

Also, add the custom styling to the select used for tags (specified by the tags prop), since that was missing.

Result

I don't feel like the images do its justice. They are now muuch better.

Overview

They are especially improved on dark theme.

Before
image
image

After
image
image


Open dropdown

Before
image
image

After
image
image


Error

Before
image

After
image


Bug?

Before
image

After
image

Testing

  • I have thoroughly tested my changes.

Tested that they still work. Multi selectors were tested after the removal of their tags prop.

@ivarnakken ivarnakken added enhancement Pull requests that make enhancements, instead of just purely new features review-needed Pull requests that need review bug-fix Pull requests that fix a bug labels Apr 6, 2023
@ivarnakken ivarnakken requested a review from a team April 6, 2023 23:29
@ivarnakken ivarnakken self-assigned this Apr 6, 2023
@linear
Copy link

linear bot commented Apr 6, 2023

ABA-243 Make Select component feel more at home

It uses blue colors that are not used elsewhere, the width and dimensions feel off and it is not so standardized (e.g. on the survey editor, it uses different hover/selected colors).

Should fix this as well:

webkom/lego#3011

Copy link
Contributor

@ollfkaih ollfkaih left a comment

Choose a reason for hiding this comment

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

LGTM 💯

@@ -145,7 +145,6 @@ const RestrictedMailEditor = ({
name="rawAddresses"
placeholder="Enkelte eposter du ønsker å sende til"
component={SelectInput.Field}
tags
Copy link
Contributor

Choose a reason for hiding this comment

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

Was tags just completely dead code?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, it enables the user to enter new things into the selector. Under the hood it uses a different component from react select. So it needs to stay.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it was dead code because it wasn't much needed that one places I tested it 🙃 I fixed it now

@@ -35,7 +35,18 @@ type Props = {
};

export const selectStyles = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to pass this into the Creatable component as well

Copy link
Contributor

@erlingfn erlingfn left a comment

Choose a reason for hiding this comment

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

Looks good! Just fix the styling for Creatableand add the tag props back, and its good!

They now share the styling of all the other input fields
in all ways. This makes them feel much more at home, and they no longer
stick out much.

Also, add the custom styling to the select used for tags (specified by
the `tags` prop), since that was missing.
@ivarnakken ivarnakken force-pushed the ivarnakken/aba-243-make-select-component-feel-more-at-home branch from eb748b1 to b07ecf1 Compare April 9, 2023 15:37
Comment on lines +120 to +121
styles={selectStyle ?? selectStyles}
theme={selectTheme}
Copy link
Member Author

Choose a reason for hiding this comment

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

@erlingfn This was the fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

ah I now see that you commented on it above 👍🏼

@ivarnakken ivarnakken requested a review from erlingfn April 9, 2023 15:40
Copy link
Contributor

@erlingfn erlingfn left a comment

Choose a reason for hiding this comment

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

LGTM

@erlingfn erlingfn merged commit b37c1ee into master Apr 10, 2023
@erlingfn erlingfn deleted the ivarnakken/aba-243-make-select-component-feel-more-at-home branch April 10, 2023 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Pull requests that fix a bug enhancement Pull requests that make enhancements, instead of just purely new features review-needed Pull requests that need review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants