Problem/Motivation

Bulma (the CSS framework) sets a fixed height on select elements that do not have the class is-multiple. This messes up auto-expansion to fit the items, including when using multiselect helpers like Select2 or TomSelect.

Steps to reproduce

Proposed resolution

Check if the field is multiselect and fix in templates/elements/select.html.twig if possible

Remaining tasks

Issue fork bulma-3279293

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

mlncn created an issue. See original summary.

mlncn’s picture

Version: 2.0.x-dev » 8.x-1.x-dev
mlncn’s picture

Doing this for 8.x-1.x-dev but should be cherry-picked for 2.0.x too i think.

mlncn’s picture

Status: Active » Needs review

Happy to be a co-maintainer here also.

nedjo’s picture

Thx!

From the Bulma documentation it doesn't look like we need the is-multiple class on the select element, just on the wrapper.

For the wrapper, we could use create_attribute() then conditionally add a class. Something like:

{% set wrapper_attributes = create_attribute().addClass('select') %}
{% if attributes.multiple == 'multiple' %}
  {% set wrapper_attributes = wrapper_attributes.addClass('select') %}
{% endif %}
{% apply spaceless %}
<div class="control"><span{{ wrapper_attributes }}>
  <select{{ attributes }}>
Happy to be a co-maintainer here also.

That would be very welcome. Unfortunately I don't have the relevant permission to add maintainers.

shyam_bhatt’s picture

Assigned: mlncn » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new14.4 KB
new16.06 KB

The "MR !3" is working fine. Please check the below image.

Before:
2022-10-14/3279293-9-before.png

After:
2022-10-14/3279293-9-after.png

  • valic committed f982fede on 8.x-1.x authored by mlncn
    Issue #3279293: Multi-select form elements are not getting the is-...
valic’s picture

Status: Reviewed & tested by the community » Fixed

tnx, committed

valic’s picture

@mlncn added you as co-maintainer

Status: Fixed » Closed (fixed)

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