question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support inline-block / sizes

See original GitHub issue

react-select only seems to work as a full-width block component. It would be nice if it would also support use as an inline-block component (like a standard <select>) with either an auto-calculated width or a specified width.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:66
  • Comments:40 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
alesncommented, Sep 30, 2015

Is there a way to make react-select be auto-sized (by content size) and not take up the full width of its parent (or having to be sized to a fixed width that would have to be calculated somehow from the content)?

10reactions
lokerscommented, Feb 20, 2019

This is the closest I can get with native style extending functionality:

  singleValue: styles => _.omit(styles, ['maxWidth', 'position', 'transform']),
  menu: styles => ({
    ...styles,
    whiteSpace: 'nowrap',
    width: 'auto',
    right: 0
  })
Read more comments on GitHub >

github_iconTop Results From Across the Web

"inline-block" | Can I use... Support tables for HTML5, CSS3, etc
CSS inline-block ... Method of displaying an element as a block while flowing it with text. Usage % of. all users, all tracked,...
Read more >
inline-size - CSS: Cascading Style Sheets - MDN Web Docs
The inline-size CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode.
Read more >
CSS Layout - display: inline-block - W3Schools
Compared to display: inline , the major difference is that display: inline-block allows to set a width and height on the element.
Read more >
When do you use inline-block? | CSS-Tricks
inline -block elements behave exactly as if they were a character of text. No breaking and they align just like text in inline...
Read more >
How to Make Inline-Block Elements Add Up to 100% Width
This solution allows you to set the width of your inline-block divs to exactly 50% without compensating for extra pixels. However, the font-size...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found