diff --git a/NOTES.md b/NOTES.md index c2076a1d7..abd5738c2 100644 --- a/NOTES.md +++ b/NOTES.md @@ -293,6 +293,13 @@ webkit doesn't let querySelectorAll select camelcase elements: * https://bugs.webkit.org/show_bug.cgi?id=83438 * https://github.com/mbostock/d3/issues/925 +Firefox does not fire a `blur` event when an element is removed from the DOM, +unlike WebKit browsers. + +Firefox does not support [the focusout event](https://bugzilla.mozilla.org/show_bug.cgi?id=687787). + +Opera does not support `pointer-events` on HTML elements, only SVG elements. + ## Transients The graph supports `transient`, which is storage for non-versioned mutable diff --git a/js/id/modes/select.js b/js/id/modes/select.js index 9397b1e98..add2e3750 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -150,10 +150,15 @@ iD.modes.Select = function(entity) { if (entity) { changeTags(entity, inspector.tags()); } + d3.select('.inspector-wrap') .style('display', 'none') .html(''); + // Firefox incorrectly implements blur, so typeahead elements + // are not correctly removed. Remove any stragglers manually. + d3.selectAll('div.typeahead').remove(); + behaviors.forEach(function(behavior) { behavior.off(surface); }); diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index 850fe84c0..aa3ad3add 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -149,9 +149,12 @@ iD.ui.inspector = function() { }); if (d.key && d.value) { taginfo.docs(params, function(err, docs) { - var en = _.find(docs, function(d) { - return d.lang == 'en'; - }); + var en; + if (!err && docs) { + en = _.find(docs, function(d) { + return d.lang == 'en'; + }); + } if (en) { var types = []; if (en.on_area) types.push('area'); @@ -170,7 +173,7 @@ iD.ui.inspector = function() { }); } else if (d.key) { taginfo.values(params, function(err, values) { - if (values.data.length) { + if (!err && values.data.length) { iD.ui.modal() .select('.content') .datum({