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.
The current modal implementation has two bugs. They both surface when you …
The two bugs are:
.modal-blind
every time, making the blind continuously darkerThis is in Recordsale when trying to add an album to my wantlist even though I'm not logged in, then clicking the back button:
To solve this, I added code to immediately destroy all open modals. I thought it's probably not worth writing a bunch of code to try and "rehydrate" the modals on back navigation. I also added a check to only contain a new
.modal-blind
if we don't already have one.I decided on this way to keep the changes and the chance for breakage minimal. If we want to keep modals open when coming back, I'd say we should maybe migrate modals to Stimulus, so Stimulus can handle all the event handlers for us.