Skip to content

Commit 9a6a16f

Browse files
Corepexaryaantony92
authored andcommitted
replaced onchange event with change eventlistener
1 parent 75a3482 commit 9a6a16f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/Resources/views/admin/customers/partials/list_filter/box/header.html.twig

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
{% endif %}
2424
<!--suppress HtmlFormInputWithoutLabel -->
2525
<select
26-
id="filterDefinition[id]"
27-
name="filterDefinition[id]"
28-
onchange="this.form.submit()"
29-
class="form-control plugin-select2"
30-
data-select2-options='{{ {'width': '50%'} | json_encode() }}'
26+
id="filterDefinition-id"
27+
name="filterDefinition[id]"
28+
class="form-control plugin-select2"
29+
data-select2-options='{{ {'width': '50%'} | json_encode() }}'
3130
>
3231
<option value="0">{{ 'cmf_filters_no_filter_selected' | trans({}, 'admin') }}</option>
3332
{% for singleFilterDefinition in filterDefinitions %}
@@ -38,11 +37,18 @@
3837
</select>
3938

4039
<a class="btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></a>
41-
4240
</div>
4341
{% endif %}
4442
</div>
4543

4644
</div>
45+
46+
<script {{ pimcore_csp.getNonceHtmlAttribute()|raw }}>
47+
window.addEventListener('load', function () {
48+
$('#filterDefinition-id').on('change', (e) => {
49+
e.target.closest('form').submit();
50+
});
51+
});
52+
</script>
4753
<!-- /.box-header -->
4854

0 commit comments

Comments
 (0)