Skip to content

Commit

Permalink
added wrapping div to align width of input & autosuggest results (#2756)
Browse files Browse the repository at this point in the history
  • Loading branch information
willcAND authored Jul 25, 2023
1 parent ab2a83c commit bdbef0f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
5 changes: 5 additions & 0 deletions src/components/autosuggest/_autosuggest.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
}
}

&__wrapper {
max-width: max-content;
width: 100%;
}

&__panel.ons-panel--warn {
background: none;
border: 0;
Expand Down
51 changes: 26 additions & 25 deletions src/components/autosuggest/_macro.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,32 @@
<div class="ons-autosuggest__instructions ons-u-vh ons-js-autosuggest-instructions" id="{{ params.id }}-instructions" tabindex="-1">{{ params.instructions }}</div>
<div class="ons-autosuggest__status ons-u-vh ons-js-autosuggest-aria-status" aria-live="assertive" aria-atomic="true" role="status" tabindex="-1"></div>
{% endset %}
<div class="ons-autosuggest__wrapper">
{{ onsInput({
"id": params.id,
"classes": "ons-js-autosuggest-input " + (params.classes if params.classes else ''),
"width": params.width,
"label": {
"text": params.label.text,
"description": params.label.description,
"id": params.label.id,
"classes": params.label.classes
},
"autocomplete": params.autocomplete,
"legend": params.legend,
"legendClasses": params.legendClasses,
"value": params.value,
"attributes": params.attributes,
"error": params.error,
"mutuallyExclusive": params.mutuallyExclusive,
"accessiblePlaceholder": params.accessiblePlaceholder,
"name": params.name,
"autosuggestResults": autosuggestResults
}) }}

{{ onsInput({
"id": params.id,
"classes": "ons-js-autosuggest-input " + (params.classes if params.classes else ''),
"width": params.width,
"label": {
"text": params.label.text,
"description": params.label.description,
"id": params.label.id,
"classes": params.label.classes
},
"autocomplete": params.autocomplete,
"legend": params.legend,
"legendClasses": params.legendClasses,
"value": params.value,
"attributes": params.attributes,
"error": params.error,
"mutuallyExclusive": params.mutuallyExclusive,
"accessiblePlaceholder": params.accessiblePlaceholder,
"name": params.name,
"autosuggestResults": autosuggestResults
}) }}

{% if not params.mutuallyExclusive %}
{{ autosuggestResults | safe }}
{% endif %}
{% if not params.mutuallyExclusive %}
{{ autosuggestResults | safe }}
{% endif %}
</div>
</div>
{% endmacro %}

0 comments on commit bdbef0f

Please sign in to comment.