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.