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

sp-container not destroyed when clicking on .sp-choose #577

Open
jolegat opened this issue May 29, 2021 · 1 comment
Open

sp-container not destroyed when clicking on .sp-choose #577

jolegat opened this issue May 29, 2021 · 1 comment

Comments

@jolegat
Copy link

jolegat commented May 29, 2021

Hello,

I am using your great color picker in a current project. I am very content with it but have following issue:

Spectrum opens when the user clicks onto (one or more)

elements (which are dynamically created upon various user interactions). spectrum is appended to the node (which I want to keep). When the user clicks somewhere outside spectrum the .sp-container is hidden, everything's fine.
But: when the user clicks onto .sp-choose an additional (hidden) .sp-container node is appended to . So each time the user opens spectrum the node receives another .sp-container.

How can I get rid of these (unused) remains?
As mentioned: this behaviour occurs only when clicking on .sp-choose.

I've tried 'destroy' and/or manually remove the .sp-container node, but then spectrum does not open at all any more.

Cheers from Vienna/Austria.
jo

@Simon-J-N-Reading
Copy link

Simon-J-N-Reading commented Jul 22, 2021

Same sort of behavior here - (duplications) - but when using inside a Worpress Divi & DiviPopup container.. pre-callling ("destroy") seems to do nothing...
IMHO (with great deference) there should be a "check for pre-existance on a given element" somewhere in the instantiation code

addendum : after much hair pulling - the closing of the Popover (making the parent element invisible) was making the spectrum elements also hidden & removing the "replacer" HTML elements - and thus inaccessible to "destroy" somehow... "destroy" has to be called before the parent is hidden : My problem was partly because (an the reason my spectrum items were increasing exponentialy Vs. by one each close) I was loading the spectrum.js script on each popup open - each spectrum.js was behaving as an independent black box (Duh!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants