diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index fa3cdbe7f..6a2e0174a 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -49,7 +49,7 @@ export function uiCombobox(context, klass) { .on('keydown.typeahead', keydown) .on('keyup.typeahead', keyup) .on('input.typeahead', change) - .on('mouseover', mouseover) + .on('mousedown', mousedown) .each(addCaret); function addCaret() { @@ -189,7 +189,7 @@ export function uiCombobox(context, klass) { } - function mouseover() { + function mousedown() { // prevent the form element from blurring. it blurs on mousedown d3_event.stopPropagation(); d3_event.preventDefault(); diff --git a/test/spec/ui/combobox.js b/test/spec/ui/combobox.js index 48953282a..a48a62ac5 100644 --- a/test/spec/ui/combobox.js +++ b/test/spec/ui/combobox.js @@ -90,7 +90,7 @@ describe('uiCombobox', function() { it('adds combobox under container', function() { input.call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(d3.select('.id-container > div.combobox').nodes().length).to.equal(1); }); @@ -106,14 +106,14 @@ describe('uiCombobox', function() { it('shows all entries when clicking on the caret', function() { input.property('value', 'foobar').call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(body.selectAll('.combobox-option').size()).to.equal(5); expect(body.selectAll('.combobox-option').text()).to.equal('foobar'); }); it('is initially shown with no selection', function() { input.call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(body.selectAll('.combobox-option.selected').size()).to.equal(0); });