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

Close the apps menu when users click anywhere else in the page #69

Closed
wants to merge 1 commit into from

Conversation

ngc1365
Copy link
Contributor

@ngc1365 ngc1365 commented Jun 30, 2022

Fixes #57.

@ngc1365 ngc1365 self-assigned this Jun 30, 2022
@ngc1365 ngc1365 linked an issue Jun 30, 2022 that may be closed by this pull request
@ngc1365 ngc1365 added the bug Something isn't working label Jun 30, 2022
@ngc1365 ngc1365 requested review from thegbk and mahasneh June 30, 2022 03:56
Copy link
Member

@thegbk thegbk left a comment

Choose a reason for hiding this comment

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

This depends on @mahasneh

this.$nuxt.$on('routeChanged', () => {
this.show = false
})
document.addEventListener('click', this.closeMenu)
Copy link
Member

Choose a reason for hiding this comment

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

@thread-koder I think using document here is breaking the Vue lifecycle somehow. Can you please her with some resources on how to attach the event listener?

Copy link
Member

Choose a reason for hiding this comment

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

@alsahawneh Hello I hope you are doing well, this way of handling events definitely breaks the Vue lifecycle, I will attach some resources for event handling in Vue:
Event Handling, explains "Listening to Events", "Event Modifiers" etc...
Component Events, explains "Emitting and Listening to Events", "Declaring Emitted Events", "Events Validation" etc...
Please don't hesitate to tell me if you need any help.

@thegbk thegbk closed this Aug 24, 2023
@thegbk thegbk deleted the fix/appsMenu branch December 3, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Category menu stays open when clicking outside the menu
3 participants