Responsive Page using Flex Box ,SASS and JavaScript

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.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @AdditionAddict
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
Join 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