tinyColorPicker icon indicating copy to clipboard operation
tinyColorPicker copied to clipboard

jQuery.fn.offset() requires a valid DOM element

Open Daijobou opened this issue 5 years ago • 0 comments

Line https://github.com/PitPik/tinyColorPicker/blob/master/jqColorPicker.js#L306 call function toggle() without a DOM element, but in toggle() you catch always $this.offset() of $this = $(this) which not exists. Line https://github.com/PitPik/tinyColorPicker/blob/master/jqColorPicker.js#L83

You get this, when you close a tinycolorpicker popup with click on the website.

maybe change line 83 to position = $this.length ? $this.offset() : null, could be a solution or put var position in if (event) block, there you only need it.

Daijobou avatar Mar 28 '20 00:03 Daijobou