Skip to content

Commit

Permalink
Fix combobox accept on click in IE11
Browse files Browse the repository at this point in the history
(closes #3991)
  • Loading branch information
bhousel committed Apr 27, 2017
1 parent 4542ad8 commit ea1e64d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/lib/d3.combobox.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as d3 from 'd3';
import { utilRebind } from '../../modules/util/rebind';
import { utilTriggerEvent } from '../../modules/util/trigger_event';


export function d3combobox() {
var event = d3.dispatch('accept'),
var dispatch = d3.dispatch('accept'),
container = d3.select(document.body),
data = [],
suggestions = [],
Expand Down Expand Up @@ -118,7 +119,7 @@ export function d3combobox() {
// tab
case 9:
wrapper.selectAll('a.selected').each(function (d) {
event.call('accept', this, d);
dispatch.call('accept', this, d);
});
hide();
break;
Expand Down Expand Up @@ -149,7 +150,7 @@ export function d3combobox() {
// return
case 13:
wrapper.selectAll('a.selected').each(function (d) {
event.call('accept', this, d);
dispatch.call('accept', this, d);
});
hide();
break;
Expand Down Expand Up @@ -258,10 +259,9 @@ export function d3combobox() {

function accept(d) {
if (!shown) return;
input
.property('value', d.value)
.dispatch('change');
event.call('accept', this, d);
input.property('value', d.value);
utilTriggerEvent(input, 'change');
dispatch.call('accept', this, d);
hide();
}
};
Expand Down Expand Up @@ -296,7 +296,7 @@ export function d3combobox() {
return combobox;
};

return utilRebind(combobox, event, 'on');
return utilRebind(combobox, dispatch, 'on');
}


Expand Down

0 comments on commit ea1e64d

Please sign in to comment.