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

Problem after upgrading to JQuery 3.5.1 #573

Open
DumboJet opened this issue Feb 23, 2021 · 2 comments
Open

Problem after upgrading to JQuery 3.5.1 #573

DumboJet opened this issue Feb 23, 2021 · 2 comments

Comments

@DumboJet
Copy link

DumboJet commented Feb 23, 2021

I am not sure how and why this happens, but after upgrading to JQuery 3.51 (from 3.4.1), a lot of my libraries broke, including spectrum.
Every instance of <i /> or <span /> had to be replaced by the corresponding non-self-closing tag, like <i></i>.
Silly HTML language...

I had to fix your library by changing this self-closing tag:
image
Otherwise, the palette was broken.

I noticed that reverting JQuery back to the old version fixed the problem, but I might be wrong, so maybe try to verify this on your end too. It might have been a different library that caused this, because it was a whole "library-upgrade day" for me when it happened...

Update:
Ohh!!!
Actually, the 1.8.1 version published here has this fix, but if you download the 1.8.0 release ZIP, it doesn't!

@stu-blair
Copy link

I can confirm that v1.8.0 breaks with the new jQuery due to the self-closing tag issue, and that the issue is fixed in v1.8.1

@jcubic
Copy link

jcubic commented Apr 9, 2021

It seems that there is bug in version 1.8.1 the problem is this code:

            function paletteElementClick(e) {
                if (e.data && e.data.ignore) {
                    set($(e.target).closest(".sp-thumb-el").data("color"));
                    move();
                }
                else {
                    set($(e.target).closest(".sp-thumb-el").data("color"));
                    move();

                    // If the picker is going to close immediately, a palette selection
                    // is a change.  Otherwise, it's a move only.
                    if (opts.hideAfterPaletteSelect) {
                        updateOriginalInput(true);
                        hide();
                    } else {
                        updateOriginalInput(); // here there should be true passed as argument
                    }
                }

                return false;
            }

When hideAfterPaletteSelect is not set it don't trigger the callback events. Which make ignore the pick of the palette.

The code should look like this:

                    updateOriginalInput(true);
                    if (opts.hideAfterPaletteSelect) {
                        hide();
                    }

If you want this to work like input, then this is breaking change.

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

3 participants