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 #9863: ContextMenu cleanup DOM events on destroy #9866

Merged
merged 1 commit into from Mar 4, 2023

Conversation

melloware
Copy link
Member

Fix #9863: ContextMenu cleanup DOM events on destroy

This adds the ability to remove all the subscribed DOM events from the document on destroy but in the scenario in the ticket I don't see why destroy is not being called? cc @tandraschko maybe i just don't understand enough about the destroy method.

@tandraschko
Copy link
Member

destroy is called when the widget does not exist anymore after the ajax request
in case it still exists, refresh is called
didnt check your case above

@melloware
Copy link
Member Author

Yep it gets rendered="false" so it should be removed from the DOM "I think".

@tandraschko
Copy link
Member

thats weird then
can you check its called for older widgets?
hope nothing is broken in jquery ui core

@melloware
Copy link
Member Author

Yep I will do some research I just wanted to make sure I understood how its supposed to work. I will let you know what I find out.

@melloware
Copy link
Member Author

melloware commented Mar 3, 2023

OK the issue is ContextMenu is attached to the document.body so it never calls destroy because

if (widget && widget.isDetached() === true) {
                        widget.destroy();

The isDetached will never be true as the Context Menu is always in the DOM.

@melloware melloware merged commit 2fca41a into primefaces:master Mar 4, 2023
@melloware melloware deleted the PF9863 branch March 4, 2023 12:30
@Rapster Rapster added the 🐞 defect Bug...Something isn't working label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 defect Bug...Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ContextMenu: cannot be conditionally toggled with ajax
3 participants