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

Fix modal freeze #1432

Merged
merged 1 commit into from
Oct 6, 2020
Merged

Fix modal freeze #1432

merged 1 commit into from
Oct 6, 2020

Conversation

st3iny
Copy link
Contributor

@st3iny st3iny commented Oct 5, 2020

The Modal component might freeze completely if it gets destroyed when its parent is destroyed. This is caused by the forced mount to body. To fix this I added a lifecycle hook that cleans up the injected html element after the component has been destroyed.

Additionally, I noticed that the modal code uses the lifecylce hook unmounted which is not existing in vue v2 (see the documentation). The dead code was moved to the corresponding hook beforeDestroy.

Found the bug while developing nextcloud/mail #3591.

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Copy link
Contributor

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

Nice catch

@juliushaertl juliushaertl added 3. to review Waiting for reviews bug Something isn't working feature: modal Related to the modal component labels Oct 6, 2020
@skjnldsv skjnldsv merged commit be5b271 into nextcloud-libraries:master Oct 6, 2020
@st3iny st3iny deleted the fix/noid/modal-freeze branch October 6, 2020 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: modal Related to the modal component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants