-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add maxWidth
Prop
#71
Conversation
Looks like a very useful addition! However, React-select also happens to be a block-level component. Since this PR is primarily aimed at fixing the bug you mentioned (which would be awesome!), how would you implement If I'm not missing something, would it make sense to accept a standard CSS length string and pass it into a This would surely be inconsistent with the current handling of |
@MilllerTime Good points. I'll take another look next week. |
After fiddling with the I still think it would be a great addition to react-input-autosize, but I'm not sure how to fix the referenced issue with react-select while maintaining fluidity 🤔 Damn tables. |
The path to least resistance (if |
Haha yeah, I was just really hoping this could avoid an onResize and the extra dependency/wrapper element of something like react-dimensions. Perhaps that is the way forward until flex layout works everywhere. I'll keep thinking about it. |
@jossmac do you have any ideas on the best approach here? |
@JedWatson All good points! I like the idea of moving React Select to a I'm not 100% that it would solve the issue at hand, but a solution can't be fair off. Type into this pen - you can see that Chrome tries to keep the cursor in view, but it's a bit jumpy. Happy to pair on it when you're free next. |
@jossmac @JedWatson Moving React Select to flexbox would surely be awesome! As you noted, support is pretty good these days, but my guess is that shoddy IE support (and no support for IE 9) might be an issue. I for one currently need to support IE9 for basic functionality. Additionally Redux, for example, is only now looking to drop IE 8 support. IE9 seems to still be on the table. Support aside, I do believe flexbox will solve the issue at hand! As I see it, the problem we're trying to solve is preventing an input element from growing too large in the first place - elegantly handling an input that is too large seems like a difficult thing to do. Here's a pen with a greatly simplified version of what React Select is doing, in both As you can see, flexbox is bulletproof, and still allows very easy centering of icons at variable heights (I imagine that was one reason React Select used table layout at all). If we're entertaining the idea of flexbox layout, might it be feasible to feature-detect support and switch to a flexbox layout automatically when supported? |
Since this is pretty old, I'm going to close it. Styles can now be overridden, which makes flexbox use possible, and we're planning to update react-select to use in in the next major version too 👍 |
This PR adds a
maxWidth
property to fix JedWatson/react-select#1127.