im using spectrum.js color picker only cancel event is not working on which i have to reset the color to inital one since im getting previewElement null.how to solve this. Answer To cancel changes to the preview you have use events like this: See example.