mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
fix search results from being stuck in highlighted state
fixes #10661, replaces and closes #10666 See https://github.com/openstreetmap/iD/pull/10666#issuecomment-2585256927 for more details about this fix
This commit is contained in:
@@ -285,18 +285,15 @@ export function uiFeatureList(context) {
|
||||
list.selectAll('.geocode-item')
|
||||
.style('display', (value && _geocodeResults === undefined) ? 'block' : 'none');
|
||||
|
||||
list.selectAll('.feature-list-item')
|
||||
.data([-1])
|
||||
.remove();
|
||||
|
||||
var items = list.selectAll('.feature-list-item')
|
||||
.data(results, function(d) { return d.id; });
|
||||
|
||||
var enter = items.enter()
|
||||
.insert('button', '.geocode-item')
|
||||
.attr('class', 'feature-list-item')
|
||||
.on('mouseover', mouseover)
|
||||
.on('mouseout', mouseout)
|
||||
.on('pointerenter', mouseover)
|
||||
.on('pointerleave', mouseout)
|
||||
.on('blur', mouseout)
|
||||
.on('click', click);
|
||||
|
||||
var label = enter
|
||||
@@ -326,23 +323,21 @@ export function uiFeatureList(context) {
|
||||
.transition()
|
||||
.style('opacity', 1);
|
||||
|
||||
items.order();
|
||||
|
||||
items.exit()
|
||||
.each(d => mouseout(undefined, d))
|
||||
.remove();
|
||||
|
||||
items.merge(enter)
|
||||
.order();
|
||||
}
|
||||
|
||||
|
||||
function mouseover(d3_event, d) {
|
||||
if (d.id === -1) return;
|
||||
|
||||
utilHighlightEntities([d.id], true, context);
|
||||
}
|
||||
|
||||
|
||||
function mouseout(d3_event, d) {
|
||||
if (d.id === -1) return;
|
||||
|
||||
utilHighlightEntities([d.id], false, context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user