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

add styleBase option to documentation #2125

Closed
ddelella opened this issue Oct 22, 2018 · 3 comments
Closed

add styleBase option to documentation #2125

ddelella opened this issue Oct 22, 2018 · 3 comments

Comments

@ddelella
Copy link

A suggestion to make the default styling match more closely to that of a form input field instead of a button. In the current markup, a button element is being added directly after the select element. This button element has the class btn and btn-light. I tried overriding the style with form-control but the override only replaced the btn-light. The btn class still remained. To make this happen currently you would need the following JavaScript:

$('.selectpicker').selectpicker({ style: 'form-control' }); $('.selectpicker + button').removeClass('btn');

I suggest we alter the style property to replace both the btn and btn-light classes or we just make form-control the default class on the button element. I have attached a screen shot of the two side by side and the code change.

image

@caseyjhol
Copy link
Member

You can use the styleBase option (which by default is set to 'btn'). For some reason this isn't in the documentation.

@caseyjhol caseyjhol changed the title Suggestion: Bootstrap default styling add styleBase option to documentation Oct 22, 2018
@abrambailey
Copy link

abrambailey commented Oct 30, 2018

Figured it out

    $('select').selectpicker({
      liveSearch: true,
      style: '',
      styleBase: 'form-control'
    });

@caseyjhol
Copy link
Member

Released in v1.13.4!

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