Browse Source

Fix issue with closing dialog in the userbar

- Remove `data-a11y-dialog-hide` and use Stimulus data action approach
- This ensures that our code is more agnostic to the third party library and can leverage our own DialogController behaviour
- Works around ally-dialog issue https://github.com/KittyGiraudel/a11y-dialog/issues/582
- Fixes #10924
LB Johnston 1 year ago
parent
commit
868398131b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      wagtail/admin/templates/wagtailadmin/shared/dialog/dialog.html

+ 2 - 2
wagtail/admin/templates/wagtailadmin/shared/dialog/dialog.html

@@ -12,9 +12,9 @@
         {% if theme %}data-w-dialog-theme-value="{{ theme }}"{% endif %}
         {% if data_url %}data-url="{{ data_url }}"{% endif %}
     >
-        <div data-a11y-dialog-hide class="w-dialog__overlay"></div>
+        <div class="w-dialog__overlay" data-action="click->w-dialog#hide"></div>
         <div class="w-dialog__box">
-            <button type="button" data-a11y-dialog-hide aria-label="{% trans 'Close dialog' %}" class="w-dialog__close-button">
+            <button type="button" class="w-dialog__close-button" aria-label="{% trans 'Close dialog' %}" data-action="w-dialog#hide">
                 {% icon name='cross' classname="w-dialog__close-icon" %}
             </button>