-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Popup] Preserve Should Be Set to False by Default #1369
Comments
Sorry, that was a mistake, or was changed since April. I'm not sure which. The correct behavior is I'll adjust the mistake in the docs as well.
This was added because So in brief $('.ui.button').popup('remove popup').popup('destroy'); |
@jlukic |
@jlukic console output
|
Tested with version 1.1.0 and 1.1.2 and it works as expected |
This has to be documented. As of 2.0.2 a new popup element is added to the body each and every time a popup is initialised on page. They are not longer created and appended to the dom as the user hovers over them. Which is contrary to what the docs say i.e "Otherwise popups will appended to body and removed after being hidden." This means if you use them with some dynamic content or angular bindings you can end up with hundreds of orphaned elements in your body. And as this thread points out calling 'destroy' should but does not remove those elements. |
@startswithaj if($popup && !settings.preserve) {
module.removePopup();
} For now you can just add |
@jlukic hey I appreciate the quick response. While this is in your mind could you clarify something for me.
If this is the case, could we put in in the documentation? In my mind calling destroy should remove any extra dom elements created. I didnt really follow the 'This was added because destroy is called when an existing component is re-initialized. ' logic? |
|
ISSUE 1
when trying to remove the Popup definitely, that's not working for me and the popup still here.
Here is a fiddle that shows the isssue.
I found an old issue about that, this comment of one of the owners said that :
Calling
will remove the popup from the DOM when you use
But sadly, doesn't work for me :(
What is the right way to definitely remove the popup from the DOM ?
ISSUE 2
Please check this fiddle
For the first time, there is only one popup added to the DOM.
The destroy button is for destroying the popup
According to the same comment , this
removes all events and disables the popup that's ok, but when you click again on the destroy button this will add a new popup to the DOM.
The text was updated successfully, but these errors were encountered: