🐛 Fixed broken close buttons on modals#15514
Merged
ronaldlangeveld merged 4 commits intoTryGhost:mainfrom Oct 4, 2022
Merged
Conversation
no issue
Some modals' close elements containing `{{on "click" @close}}` and `href=""` would not take the 'on cl
ick' function into account, meaning the whole page would get redirected to "/" (back to the root of the dashboard) instead of just closing the modal.
Codecov ReportBase: 52.90% // Head: 52.86% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #15514 +/- ##
==========================================
- Coverage 52.90% 52.86% -0.04%
==========================================
Files 1376 1377 +1
Lines 89210 89237 +27
Branches 9573 9569 -4
==========================================
- Hits 47197 47177 -20
- Misses 41055 41096 +41
- Partials 958 964 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
close button on modalsclose buttons on modals
kevinansfield
approved these changes
Oct 3, 2022
Member
kevinansfield
left a comment
There was a problem hiding this comment.
LGTM 👍 Very minor thing but the role="button" attributes can be removed on actual <button> elements because they're redundant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Certain modals have close buttons as
<a>elements. Those containing{{on "click" @close}}andhref=""would not take theon clickfunction into account, meaning the whole page would get redirected to"/"(back to the root of the dashboard) as a result of thehrefinstead of closing the modal.From my understanding
{{on "click" @close}}doesn't enforcepreventDefaultbehaviour.Reproducible example:
Go to members, apply some filters, click ⚙️ and select "Add label for selected members". The modal should open.
Click the Close (X) button top right of the modal.
This affects more modals, this is just one example.
Version: 5.16.2
Ghost Pro
Chrome and Safari
yarn test:allandyarn lint)