Skip to content
Snippets Groups Projects
Commit 0f2c5525 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-5946: modify select count to not adjust if size is already set

parent fba3f363
No related branches found
No related tags found
1 merge request!88ISTWCMS-5946: adding twig logic to add size to attributes array for select
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
* @ingroup themeable * @ingroup themeable
*/ */
#} #}
{# look at the options array and if < 4 then use for the size attribute #} {# if size is not set, look at the options array and if < 4 then use for the size attribute #}
{% if options|length < 4 %} {% if not attributes.size and options|length < 4 %}
{% set select_size = options|length %} {% set attributes = attributes.setAttribute('size', options|length) %}
{% endif %} {% endif %}
{% apply spaceless %} {% apply spaceless %}
<select{{ attributes.setAttribute('size', select_size) }}> <select{{ attributes }}>
{% for option in options %} {% for option in options %}
{% if option.type == 'optgroup' %} {% if option.type == 'optgroup' %}
<optgroup label="{{ option.label }}"> <optgroup label="{{ option.label }}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment