If a calendar selector is used as filter in a form filter (forms/filter_items.xml, e.g.) and a date is selected, when you press the filter clear button the calendar selector does not clear its content and the filter bar is not hidden at all.
6.1.0
The selected date might be deleted and all the filter bar would be hidden.
The selected date is not removed and all the filter bar is shown.
The input type="text" of the calendar selector has a data attribute (data-alt-value) which is not be cleared in the method 'clear' (line 245) of searchtools.js
If that data attribute is not clear, the calendar submit the previous selected date and when the view is loaded again, the calendar shows a value and the filter bar is not hidden.
So, clear method in searchtools.js must remove this data attribute after deleting the input value:
i.dataset.altValue = '';
An example of form filter is included to replicate the issue:
<?xml version="1.0" encoding="UTF-8"?>
<form>
<fields name="filter">
<field
name="search"
type="text"
inputmode="search"
label="LABEL"
description="DESCRIPTION"
hint="JSEARCH_FILTER"
/>
<field
name="begin"
type="calendar"
format="%d-%m-%Y"
filter="user_utc"
translateformat="true"
/>
</fields>
<fields name="list">
<field
name="fullordering"
type="list"
label="JGLOBAL_SORT_BY"
statuses="*,0,1,2,-2"
class="js-select-submit-on-change"
default="a.id ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
</field>
<field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
class="js-select-submit-on-change"
/>
</fields>
</form>
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||
An example to recreate the issue:
JGLOBAL_SORT_BY JGRID_HEADING_ID_ASC JGRID_HEADING_ID_DESC <field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
class="js-select-submit-on-change"
/>
</fields>
An example to recreate the issue:
JGLOBAL_SORT_BY JGRID_HEADING_ID_ASC JGRID_HEADING_ID_DESC <field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
class="js-select-submit-on-change"
/>
</fields>
An example of form filter is attached to recreate the issue.
An example of form filter is attached to recreate the issue.
Example
Example
Example
Example
An example of form filter to replicate this issue:
...xml
JGLOBAL_SORT_BY JGRID_HEADING_ID_ASC JGRID_HEADING_ID_DESC <field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
class="js-select-submit-on-change"
/>
</fields>
...
An example of form filter to replicate this issue:
...xml
JGLOBAL_SORT_BY JGRID_HEADING_ID_ASC JGRID_HEADING_ID_DESC <field
name="limit"
type="limitbox"
label="JGLOBAL_LIST_LIMIT"
default="25"
class="js-select-submit-on-change"
/>
</fields>
...
Nothing is attached.