Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with closing dialog in the userbar #10934

Conversation

lb-
Copy link
Member

@lb- lb- commented Sep 21, 2023


  • Do the tests still pass?
  • Does the code comply with the style guide?
  • For Python changes: Have you added tests to cover the new/fixed behaviour? N/A
  • For front-end changes: Did you test on all of Wagtail’s supported environments? Firefox 115, Chrome 117, Safari 16.1 all on MacOS 13.0

@lb- lb- added this to the 5.2 milestone Sep 21, 2023
@squash-labs
Copy link

squash-labs bot commented Sep 21, 2023

Manage this branch in Squash

Test this branch here: https://lb-fix10924-ensure-dialog-clos-0gcfy.squash.io

@lb- lb- force-pushed the fix/10924-ensure-dialog-close-works-within-web-components branch 3 times, most recently from b531bec to 018e216 Compare September 25, 2023 19:39
- 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 KittyGiraudel/a11y-dialog#582
- Fixes wagtail#10924
@lb- lb- force-pushed the fix/10924-ensure-dialog-close-works-within-web-components branch from 018e216 to 45c95ab Compare October 9, 2023 10:11
Copy link
Member

@laymonage laymonage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LB, if you have the time could you perhaps help review KittyGiraudel/a11y-dialog#589?

I'm not averse to these changes, but I don't know what Thibaud would prefer since I think it's possible that we can fix this just by updating a11y-dialog when a new version is released with that fix merged (assuming that happens in the near future)

@lb-
Copy link
Member Author

lb- commented Oct 10, 2023

@laymonage haha, oh man, OK I am not sure I can really review that PR easily, it's a bit beyond what I know and fully understand. Gave it a go this morning and maybe I'll have a chance to do a deep dive in the coming week or so.

I agree we should get an third party fix, however, I would still think this PR makes sense as it removes our coupling with the external library in the HTML. The third party fix may still be required for things like esc handling anyway.

Similar to tooltips, our Controller attributes are the HTML API and then the way the Controller behaves (third party library or not) is always the same. This way we can avoid changing our HTML each time we have to upgrade/change an underlying JS library.

Anyway, I will try to get my head around that PR and see how I go.

@laymonage laymonage self-requested a review October 18, 2023 10:35
Copy link
Member

@laymonage laymonage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this and works well, thank you! As agreed on the core team meeting, we'd like to have this even when the issue in A11yDialog is fixed, because this makes better use of our Stimulus abstraction which can still work even if we swap the underlying library.

I'm not adding release notes as this is a regression in the main branch.

@laymonage laymonage merged commit 8683981 into wagtail:main Oct 18, 2023
20 checks passed
@lb- lb- deleted the fix/10924-ensure-dialog-close-works-within-web-components branch October 18, 2023 19:57
@lb-
Copy link
Member Author

lb- commented Oct 18, 2023

Thank you Sage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Accessibility checker dialog cannot be closed by clicking the X button
2 participants