Don’t filter ‘All of’ choice with live search

Because the ‘All of’ choice appears above the search field, it shouldn’t
be filtered by the search field.

We can fix this by wrapping the sub-areas in a `<div>` and make the
selector more specific.
This commit is contained in:
Chris Hill-Scott
2020-08-26 10:59:29 +01:00
parent 19ce1bd43a
commit 2ede3ef8f0
2 changed files with 20 additions and 6 deletions

View File

@@ -22,9 +22,11 @@
{{ form.select_all }}
</div>
{{ live_search(target_selector='.govuk-checkboxes__item', show=show_search_form, form=search_form, label='Or by electoral ward') }}
{{ live_search(target_selector='#sub-areas .govuk-checkboxes__item', show=show_search_form, form=search_form, label='Or by electoral ward') }}
{{ form.areas }}
<div id="sub-areas">
{{ form.areas }}
</div>
{{ sticky_page_footer('Add to broadcast') }}