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

Single value layout fix #4720

Merged
merged 7 commits into from
Sep 3, 2021

Conversation

seancurtis
Copy link
Collaborator

The absolute positioning pulls both the value and the placeholder out of the flow, and thus the component itself collapses down when used as a flex child. This can be solved by wrapping the component in another div, but we can solve it better by using CSS Grid instead.

before-after

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2021

🦋 Changeset detected

Latest commit: 3de0504

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-select Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 13, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3de0504:

Sandbox Source
react-codesandboxer-example Configuration

@seancurtis seancurtis added this to the 5.0 milestone Aug 13, 2021
Copy link
Collaborator

@Rall3n Rall3n left a comment

Choose a reason for hiding this comment

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

image

Value, placeholder and input are centered by default instead of left aligned.

@seancurtis seancurtis force-pushed the singleValue-layout-fix branch 3 times, most recently from 2c69f1d to ad9c88f Compare August 30, 2021 02:13
@seancurtis
Copy link
Collaborator Author

@Rall3n thanks for the catch in the layout when expanded. I was working on it using a fixture to test the flex content and as such it was constantly squashed. I just reverted it before pushing. I did some more fixes to the layout/alignment as I noticed another issue too. It's much more solid now.

Copy link
Collaborator

@Rall3n Rall3n left a comment

Choose a reason for hiding this comment

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

One last thing, but everything else looks ok.

@@ -29,11 +29,9 @@ export const placeholderCSS = <
}: PlaceholderProps<Option, IsMulti, Group>): CSSObjectWithLabel => ({
label: 'placeholder',
color: colors.neutral50,
gridArea: '1 / 2',
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

Forgot to provide the Placehholder component with the latest fix :)

@seancurtis
Copy link
Collaborator Author

D'oh! Not sure how I missed that one tbh. Should be good now.

@seancurtis seancurtis requested a review from Rall3n August 30, 2021 23:49
Copy link
Collaborator

@Rall3n Rall3n 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 now 👍

Copy link
Owner

@JedWatson JedWatson left a comment

Choose a reason for hiding this comment

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

Nice! Ha, love css grids, this is so neat now. Thanks @seancurtis

@JedWatson JedWatson merged commit ed15c73 into JedWatson:master Sep 3, 2021
@github-actions github-actions bot mentioned this pull request Sep 3, 2021
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.

4 participants