Ensure all combobox inputs have a carat

Previously, the second combobox input for a given parent
element would wind up without a carat, because the data
bind would match the first carat.

Fixes #1549.
This commit is contained in:
John Firebaugh
2013-05-30 15:50:40 -07:00
parent 814535ad34
commit f02df04102
+2 -1
View File
@@ -25,7 +25,8 @@ d3.combobox = function() {
sibling = this.nextSibling;
var carat = d3.select(parent).selectAll('.combobox-carat')
.data([0]);
.filter(function(d) { return d === input.node(); })
.data([input.node()]);
carat.enter().insert('div', function() { return sibling; })
.attr('class', 'combobox-carat');