From f02df04102e8da4561e66fa7887e9683d582c222 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 30 May 2013 15:50:40 -0700 Subject: [PATCH] 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. --- js/lib/d3.combobox.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/lib/d3.combobox.js b/js/lib/d3.combobox.js index dfc985b6c..36a8f946d 100644 --- a/js/lib/d3.combobox.js +++ b/js/lib/d3.combobox.js @@ -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');