spectrum
spectrum copied to clipboard
change event multiple triggers
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
});