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

Select2 styling #328

Open
krysros opened this issue Dec 30, 2016 · 5 comments
Open

Select2 styling #328

krysros opened this issue Dec 30, 2016 · 5 comments

Comments

@krysros
Copy link
Contributor

krysros commented Dec 30, 2016

There is some styling issues with select2 widget:

  1. height - which is smaller than normal select or input
  2. width - does not resize with the size of the window (related to Issues with responsive width select2/select2#3278)
  3. does not includes validation styles for error
  4. does not switch to next widget using tab on keyboard after selection of item

Example:

  1. Change the size of the browser window
  2. Refresh the page
  3. Return to the previous window size

select2

@mikmatko
Copy link

mikmatko commented Jan 9, 2017

I think the main problem for

height - which is smaller than normal select or input
does not includes validation styles for error

is that the "form-control" class is not added to the correct element. This can be fixed with something like $('#select2-' + oid + '-container').addClass('form-control');
in the select2 template.

That and some styling tweaks should do it.

(Currently containerCssClass: 'form-control', is passed for the Select2 constructor, but it might be unnecessary. It adds the class to the "wrong" element.)

@mikmatko
Copy link

Came across these issues too.

To fix the styling issues I have used select2-bootstrap-theme from https://github.com/select2/select2-bootstrap-theme. Imho, deform should include this.

To fix the resizing issue set width: null, when initializing select2.

@stevepiercy
Copy link
Member

@mikmatko I would accept a PR with your proposed changes.

@stevepiercy
Copy link
Member

Also @krysros or anyone else, I would gladly accept a PR that fixes all these issues. Thanks for reporting and offering a solution.

@stevepiercy
Copy link
Member

A PR to fix this can be done according to the version of Deform and Bootstrap.

A PR for either should add what @mikmatko suggests. I'll do the forward/back-porting as needed.

@stevepiercy stevepiercy added this to the 3.1.0 milestone Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants