Skip to content

Conversation

@fforres
Copy link
Contributor

@fforres fforres commented Feb 25, 2018

Hallo @Rowno @jeroenransijn
I came across a case where I needed to customize the width of the searchInput box.

Passing a 'width' prop to SearchInput only set the container's width and not the input, so hopefully this pr fixes that.

While It could've been done with CSS classes, I wanted to add the fix to evergreen.
My other idea was to modify splitBoxProps to pass another parameter of whitelisted keys that should not be removed.

Screenshot of storybook

image

@fforres fforres changed the title Adding width Making SearchInput width-aware Feb 25, 2018
Copy link
Contributor

@nettofarah nettofarah left a comment

Choose a reason for hiding this comment

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

Nice find!

paddingLeft={height}
appearance={appearance}
disable={disabled}
width={width}
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 a better solution would be to add display="block" and width={null} to TextInput so it just stretches to fill the parent Box.

Copy link
Contributor Author

@fforres fforres Feb 26, 2018

Choose a reason for hiding this comment

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

I tested it, and it works if the parent Box has an explicit width.
If the parent's Box width is not set up, the TextInput wont expand to fill up space.

image

@jeroenransijn
Copy link
Contributor

Thanks @fforres for taking a look at this and fixing this! This was totally an annoying bug in Evergreen ❤️

@fforres fforres merged commit 4d26492 into master Feb 26, 2018
@fforres fforres deleted the fforres/searchinpuwidth branch February 26, 2018 19:05
prateekgoel pushed a commit to prateekgoel/evergreen that referenced this pull request Oct 26, 2018
* Adding width

* Adding default width
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.

6 participants