mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Show all combobox entries when clicking the caret (fixes #1755)
This commit is contained in:
@@ -44,11 +44,12 @@ d3.combobox = function() {
|
||||
d3.event.stopPropagation();
|
||||
d3.event.preventDefault();
|
||||
input.node().focus();
|
||||
fetch('', render);
|
||||
});
|
||||
});
|
||||
|
||||
function focus() {
|
||||
fetch(render);
|
||||
fetch(value(), render);
|
||||
}
|
||||
|
||||
function blur() {
|
||||
@@ -138,7 +139,7 @@ d3.combobox = function() {
|
||||
}
|
||||
|
||||
function change() {
|
||||
fetch(function() {
|
||||
fetch(value(), function() {
|
||||
autocomplete();
|
||||
render();
|
||||
});
|
||||
@@ -163,8 +164,8 @@ d3.combobox = function() {
|
||||
return value;
|
||||
}
|
||||
|
||||
function fetch(cb) {
|
||||
fetcher.call(input, value(), function(_) {
|
||||
function fetch(v, cb) {
|
||||
fetcher.call(input, v, function(_) {
|
||||
suggestions = _;
|
||||
cb();
|
||||
});
|
||||
|
||||
@@ -95,6 +95,13 @@ describe("d3.combobox", function() {
|
||||
expect(body.selectAll('.combobox-option').size()).to.equal(0);
|
||||
});
|
||||
|
||||
it("shows all entries when clicking on the caret", function() {
|
||||
input.property('value', 'foo').call(combobox.data(data));
|
||||
happen.mousedown(body.selectAll('.combobox-caret').node());
|
||||
expect(body.selectAll('.combobox-option').size()).to.equal(3);
|
||||
expect(body.selectAll('.combobox-option').text()).to.equal('foo');
|
||||
});
|
||||
|
||||
it("is initially shown with no selection", function() {
|
||||
input.call(combobox.data(data));
|
||||
input.node().focus();
|
||||
|
||||
Reference in New Issue
Block a user