Problem/Motivation

select elements get "form-control" class via select.html.twig. This is not correct imho, as Bootstrap uses "form-select" class for select elements, see https://getbootstrap.com/docs/5.2/forms/select/

Steps to reproduce

use a select element with Bootstrap theme and inspect the class.

Proposed resolution

change class to "form-select" in select.html.twig

Remaining tasks

create a patch

User interface changes

bootstrap styling according to "form-select" class

API changes

na

Data model changes

na

Issue fork bootstrap5-3330099

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

stefan.korn created an issue. See original summary.

stefan.korn’s picture

Status: Active » Needs review
StatusFileSize
new464 bytes
stefan.korn’s picture

Looking a bit deeper into this, Drupal is itself already adding "form-select" in template_preprocess_select. So imho the select.html.twig can be removed from Bootstrap theme, since the only relevant change to core's version seems to be adding the "form-control" class. But this is not necessary for a bootstrap select and in someway it is even incorrect.

So providing another patch for deleting the select.html.twig.

jannakha’s picture

Version: 3.0.x-dev » 4.0.x-dev

needs to be ported to v4

jannakha’s picture

Status: Needs review » Needs work
anirudhsingh19’s picture

Assigned: Unassigned » anirudhsingh19

working on this!

anirudhsingh19’s picture

Assigned: anirudhsingh19 » Unassigned
Status: Needs work » Needs review

Removed select.html.twig as suggested in #3. Please review.

jannakha’s picture

Status: Needs review » Reviewed & tested by the community

thank you for your contribution.
tested, works as expected.

ready for release.

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you. Committed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • vladimiraus committed dd4a74a8 on 4.0.x
    feat: #3330099 select should get form-select class instead of form-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.