Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The core entity reference autocomplete widget has "Size of textfield" setting which allows you to control the size of the widget on the form.
Proposed resolution
Implement "Size of textfield" setting for Select2 widget as well.
Comments
Comment #2
chr.fritschThis is not so easy I guess. The select2 element has not a size property. We could use select2s width property, but that only accepts css width values.
So I don't know how to map a input size value to a CSS width value.
Comment #3
chr.fritschOk, here is a PR. So when we have the choice to put in %, px or em, why shouldn't we use it.
https://github.com/thunder/select2/pull/40
Comment #5
chr.fritschAdding review credits
Comment #7
chr.fritschCommitted