From 5473b5643f94a00ff6e3cbef0432de33c4d7fb50 Mon Sep 17 00:00:00 2001
From: Matt Westcott <matt@west.co.tt>
Date: Mon, 11 Apr 2022 12:06:28 +0100
Subject: [PATCH] Further locale picker fixes:

* Remove dropdown behaviour when switcher legitimately only contains a single locale
* Don't omit listing when there are no child pages, because it's possible to land on a page with no children when switching locales
---
 .../templates/wagtailadmin/chooser/_browse_results.html   | 8 +++-----
 .../templates/wagtailadmin/shared/chooser_breadcrumb.html | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/wagtail/admin/templates/wagtailadmin/chooser/_browse_results.html b/wagtail/admin/templates/wagtailadmin/chooser/_browse_results.html
index 8b4a48a5cb..2ca18b5f5b 100644
--- a/wagtail/admin/templates/wagtailadmin/chooser/_browse_results.html
+++ b/wagtail/admin/templates/wagtailadmin/chooser/_browse_results.html
@@ -2,9 +2,7 @@
 
 {% include "wagtailadmin/shared/chooser_breadcrumb.html" with page=parent_page show_locale_labels=show_locale_labels %}
 
-{% if pages %}
-    {% include "wagtailadmin/pages/listing/_list_choose.html" with allow_navigation=1 orderable=0 pages=pages parent_page=parent_page show_locale_labels=show_locale_labels %}
+{% include "wagtailadmin/pages/listing/_list_choose.html" with allow_navigation=1 orderable=0 pages=pages parent_page=parent_page show_locale_labels=show_locale_labels %}
 
-    {% url 'wagtailadmin_choose_page_child' parent_page.id as pagination_base_url %}
-    {% paginate pages base_url=pagination_base_url classnames="navigate-pages" %}
-{% endif %}
+{% url 'wagtailadmin_choose_page_child' parent_page.id as pagination_base_url %}
+{% paginate pages base_url=pagination_base_url classnames="navigate-pages" %}
diff --git a/wagtail/admin/templates/wagtailadmin/shared/chooser_breadcrumb.html b/wagtail/admin/templates/wagtailadmin/shared/chooser_breadcrumb.html
index 699c38ace9..700b32bcb2 100644
--- a/wagtail/admin/templates/wagtailadmin/shared/chooser_breadcrumb.html
+++ b/wagtail/admin/templates/wagtailadmin/shared/chooser_breadcrumb.html
@@ -10,7 +10,7 @@
                     {% include "wagtailadmin/shared/locale_selector.html" with translations=locale_options locale=page.locale only %}
                 {% endif %}
             {% else %}
-                <div class="c-dropdown t-inverted {{ class }}" style="display: inline-block;" data-dropdown>
+                <div class="c-dropdown t-inverted {{ class }}" style="display: inline-block;">
                     <div aria-label="{{ page.locale.get_display_name }}" class="c-dropdown__button u-btn-current">
                         {% icon name="site" class_name="default" %}
                         {{ page.locale.get_display_name }}