From d8302a0ab7da016984984a4df40dcd0b4cf254a6 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Thu, 31 Jul 2014 15:38:47 +1200 Subject: [PATCH] BUG Add a synthetic event to workaround IE8 issues. Without this event it's not possible to hook into the value change in a reliable way (panelhide event is called too many times to rely on it). --- javascript/TreeDropdownField.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/javascript/TreeDropdownField.js b/javascript/TreeDropdownField.js index b6faeb8236d..c0e452a8cdc 100644 --- a/javascript/TreeDropdownField.js +++ b/javascript/TreeDropdownField.js @@ -173,7 +173,11 @@ }, setValue: function(val) { this.data('metadata', $.extend(this.data('metadata'), {id: val})); - this.find(':input:hidden').val(val).trigger('change'); + this.find(':input:hidden').val(val) + // Trigger synthetic event so subscribers can workaround the IE8 problem with 'change' events + // not propagating on hidden inputs. 'change' is still triggered for backwards compatiblity. + .trigger('valueupdated') + .trigger('change'); }, getValue: function() { return this.find(':input:hidden').val();