mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user