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

Style of width:auto does not allow the select2 to expand when in a modal... #35

Closed
joetidee opened this issue Jun 13, 2016 · 7 comments
Closed

Comments

@joetidee
Copy link

I have added the folliwing to my Select2 component:

<Select2
    ...
    style={{width:'auto'}}
    ...
/>

This component is rendered as part of a bootstrap modal dialog. The contents of the dropdow list do not force it to expand fully.

If I use this width:auto on a component that is NOT in a modal dialog, it worls ok. Any ideas why this does not work in a modal?

@rkit
Copy link
Owner

rkit commented Jun 17, 2016

I don't even know… Maybe this help you:
select2/select2#3101 ( dropdownAutoWidth )

@rkit rkit closed this as completed Aug 14, 2016
@gazpachu
Copy link

gazpachu commented Nov 22, 2016

@rkit How does the dynamic width work? I've been trying different approaches to make it responsive, but the <input> always end up defining the final width of the whole thing.

@rkit
Copy link
Owner

rkit commented Nov 24, 2016

@gazpachu I don't know. I never faced such a problem, sorry

@gazpachu
Copy link

@rkit This is what I mean (see below). It seems they get random widths:

screen shot 2016-11-25 at 17 15 20

@rkit
Copy link
Owner

rkit commented Nov 26, 2016

@gazpachu I guess you should play with css, style={{width: x'}} and option dropdownAutoWidth

@gazpachu
Copy link

@rkit setting the dropdownAutoWidth option to true or false doesn't seem to change anything. It doesn't matter if I add a style={{width: x'}} cause it gets overwritten with the fixed px width value set by the component.

@rkit
Copy link
Owner

rkit commented Nov 30, 2016

@gazpachu Maybe it is better to create an issue in Select2? This component doesn't add any CSS styles.

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

No branches or pull requests

3 participants