Design comparison
Solution retrospective
On desktop mode when the "dismiss" button is pressed, the layout returns to the mobile view. I am unsure why this happens and the way I found to fix it was to use "location.reload()". I would appreciate if anyone could explain why this happens.
Criticism on any part of my code is highly welcome.
Community feedback
- @AdditionAddictPosted about 1 year ago
On mobile so can’t run code but I’d have type=“button” on the dismiss button. type=“submit” is usually paired with a form and immediate posting of data to the server causing a refresh. A lot of web frameworks that implement forms do a preventDefault because it isn’t the 90s anymore and php use isn’t so prevalent
0@DavedCNPosted about 1 year ago@AdditionAddict I don't really understand the first part of your statement. I have changed type to submit on the dismiss button.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord