Skip to content

Commit

Permalink
Fixes #2362 Publication Views exposed filters overlap (#2469)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadean authored Jun 14, 2023
1 parent 3b3f2fc commit 6f7fceb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions modules/custom/az_publication/az_publication.module
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,19 @@ function az_publication_preprocess_views_view(&$variables) {
if (!empty($variables['id'])) {
// Only run for publication search.
if ($variables['id'] === 'az_publications') {
// Allow the publication year field to shrink if present.
// Reduce the width of the text input form elements from the default.
$resize_element = [
'name',
'title',
];
foreach ($resize_element as $element) {
if (!empty($variables['exposed'][$element])) {
$variables['exposed'][$element]['#size'] = 20;
}
}
// Year field doesn't need a standard width text field.
if (!empty($variables['exposed']['field_az_publication_date_value'])) {
$variables['exposed']['field_az_publication_date_value']['#wrapper_attributes']['class'][] = 'flex-shrink-1';
$variables['exposed']['field_az_publication_date_value']['#size'] = 6;
}
if (!empty($variables['exposed']['field_az_publication_type_value'])) {
// Add class so publication type select is styled like text inputs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
#}
{{ q }}
{% endif %}
<div class="form-row flex-lg-nowrap">
<div class="form-row">
{{ form }}
</div>

0 comments on commit 6f7fceb

Please sign in to comment.