Skip to content

Commit cd51d00

Browse files
committed
Handle blur correctly
1 parent b48485f commit cd51d00

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Griddly/Scripts/editly.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
var handleBlur = function () {
181181
// TODO: is there a more efficient way for this?
182182
if (!$(document.activeElement).parents().is(template)) {
183-
if (editor.valid()) {
183+
if (!validator || editor.valid()) {
184184
saveActive();
185185

186186
hideEditor();
@@ -207,10 +207,8 @@
207207
.width(template == editor ? active.width() : active.outerWidth())
208208
.height(template == editor ? active.height() : active.outerHeight())
209209
.off("blur change");
210-
if(template.tagName=="INPUT")
211-
template.on("blur change", function () {
212-
setTimeout(handleBlur, 1);
213-
});
210+
211+
editor.on("blur change", handleBlur);
214212

215213
var value = active.data("value");
216214
if (value === undefined)

0 commit comments

Comments
 (0)