Date field collapsible filters with exposed operator expand when any filter used

Created on 30 October 2024, about 2 months ago

Problem/Motivation

Date field filters with exposed operator and set to "Default" widget appear as expanded when form is submitted even when the date filter has not been used and has no value.

Other filters such as text filters will not expand if the filter has no value.

This behaviour also occurs if the JQuery UI Date Picker module is used and the DatePicker filter widget.

Steps to reproduce

If a filter for a date field is set to collapsible via the "Make filter options collapsible" option and the date filter widget is "Default," it correctly appears as collapsed when the view and filter form first appear.

However, if the filter form is submitted with any values other than the date filter -- even no values -- the collapsible date filter will appear as expanded, even though it has not been used.

The URL created by submitting the filter will be something like:

website.com/myview?otherfilter=something&date_op=%3D&date%5Bvalue%5D=

where date_op is the exposed operator and date is the filter

Removing &date%5Bvalue%5D= from the URL loads the page with the filter collapsed as expected.

Proposed resolution

Alter the javascript expanding the filter to check if there is a real submitted value first for the date filter.

Feature request
Status

Active

Version

7.0

Component

Code

Created by

🇨🇦Canada endless_wander

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024