diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-10-20 19:10:28 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-10-21 10:32:46 +0200 |
commit | 34d3f99aae7783c4c91c29b427d412a7a85d2647 (patch) | |
tree | 548ccc43f64d02b83fe194cf62d7dbeba73674bf | |
parent | 41a7d0bf472b21018715eedf0b4c56ccbeace1f1 (diff) | |
download | freeipa-34d3f99aae7783c4c91c29b427d412a7a85d2647.tar.gz freeipa-34d3f99aae7783c4c91c29b427d412a7a85d2647.tar.xz freeipa-34d3f99aae7783c4c91c29b427d412a7a85d2647.zip |
webui: update combobox input on list click
Change event of combobox is not triggered when there is only one value. Calling it's handler even for option's 'click' event makes sure that value of input gets always updated.
https://fedorahosted.org/freeipa/ticket/4655
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
-rw-r--r-- | install/ui/src/freeipa/widget.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 39ee19b8d..9240df8ef 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -3826,10 +3826,13 @@ IPA.combobox_widget = function(spec) { that.list_on_change = function(e) { + var org_val = that.input.val(); var value = that.list.val(); - that.input.val(value); - that.value_changed.notify([[value]], that); - that.emit('value-change', { source: that, value: value }); + if (org_val != value) { + that.input.val(value); + that.value_changed.notify([[value]], that); + that.emit('value-change', { source: that, value: value }); + } }; that.list_child_on_blur = function(e) { @@ -3852,6 +3855,7 @@ IPA.combobox_widget = function(spec) { // Close list when user selects and option by click // doesn't work in IE, can be fixed by moving the handler to list.click, // but it breaks UI automation tests. #3014 + that.list_on_change(); that.close(); IPA.select_range(that.input, 0, 0); }; |