mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-16 18:52:57 +00:00
Ensure combobox suggestion menu is closed on blur
The combobox's blur handler needs to be called prior to the tag editor's blur handler. The latter can cause a re-render, which will rebind handlers. Rebound handlers are not called during the same event dispatch cycle, so when the combobox blur handler is last, it sometimes doesn't get called, stranding the menu.
This commit is contained in:
@@ -86,24 +86,6 @@ iD.ui.RawTagEditor = function(context) {
|
|||||||
|
|
||||||
$items.order();
|
$items.order();
|
||||||
|
|
||||||
$items.select('input.key')
|
|
||||||
.property('value', function(d) {
|
|
||||||
return d.key;
|
|
||||||
})
|
|
||||||
.on('blur', keyChange)
|
|
||||||
.on('change', keyChange);
|
|
||||||
|
|
||||||
$items.select('input.value')
|
|
||||||
.property('value', function(d) {
|
|
||||||
return d.value;
|
|
||||||
})
|
|
||||||
.on('blur', valueChange)
|
|
||||||
.on('change', valueChange)
|
|
||||||
.on('keydown.push-more', pushMore);
|
|
||||||
|
|
||||||
$items.select('button.remove')
|
|
||||||
.on('click', removeTag);
|
|
||||||
|
|
||||||
$items.each(function(tag) {
|
$items.each(function(tag) {
|
||||||
d3.select(this)
|
d3.select(this)
|
||||||
.each(bindTypeahead)
|
.each(bindTypeahead)
|
||||||
@@ -111,6 +93,20 @@ iD.ui.RawTagEditor = function(context) {
|
|||||||
.call(tag.reference.body);
|
.call(tag.reference.body);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$items.select('input.key')
|
||||||
|
.property('value', function(d) { return d.key; })
|
||||||
|
.on('blur', keyChange)
|
||||||
|
.on('change', keyChange);
|
||||||
|
|
||||||
|
$items.select('input.value')
|
||||||
|
.property('value', function(d) { return d.value; })
|
||||||
|
.on('blur', valueChange)
|
||||||
|
.on('change', valueChange)
|
||||||
|
.on('keydown.push-more', pushMore);
|
||||||
|
|
||||||
|
$items.select('button.remove')
|
||||||
|
.on('click', removeTag);
|
||||||
|
|
||||||
$items.exit()
|
$items.exit()
|
||||||
.remove();
|
.remove();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user