spectrum icon indicating copy to clipboard operation
spectrum copied to clipboard

change event multiple triggers

Open frumbert opened this issue 7 years ago • 0 comments

When I initialise the spectrum with hideAfterPalletteSelect and clickoutFiresChange both true, I receive many calls to the change event (opening and closing the picker twice or more will results in a maximum call stack exceeded message).

$("input[type='text'].colour-picker").spectrum({
			preferredFormat: "hex",
			showAlpha: false,
			showPalette: true,
			hideAfterPaletteSelect:true,
			clickoutFiresChange: true,
			change: spectrumColour,
			showInput: true
});

function spectrumColour(v) { console.log(v); }

with the same setup but no clickout fires change, the change event is only called once but never flooded.

$("input[type='text'].colour-picker").spectrum({
			preferredFormat: "hex",
			showAlpha: false,
			showPalette: true,
			hideAfterPaletteSelect:true,
			clickoutFiresChange: false,
			change: spectrumColour,
			showInput: true
});

frumbert avatar Jun 26 '17 08:06 frumbert