Skip to content

Commit a33dd95

Browse files
authored
fix(ui5-input): stop firing focusout on suggestion click (#1857)
The "focusout" event used to be fired whenever the user interacts with the suggestion lists, misleading the ones that listens for the event, that the user has clicked somewhere outside. Now, it is not fired. Fixes: #1846
1 parent 0153b32 commit a33dd95

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/main/src/Input.js

+1
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ class Input extends UI5Element {
582582
// if focusout is triggered by pressing on suggestion item or value state message popover, skip invalidation, because re-rendering
583583
// will happen before "itemPress" event, which will make item "active" state not visualized
584584
if (focusedOutToSuggestions || focusedOutToValueStateMessage) {
585+
event.stopImmediatePropagation();
585586
return;
586587
}
587588

packages/main/test/pages/Input.html

+4
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@ <h3> Input with multiple icons</h3>
366366
quickViewCard.close(false, true, true);
367367
});
368368
});
369+
370+
inputPreview.addEventListener("focusout", function (event) {
371+
console.log("focusout");
372+
});
369373
</script>
370374
</body>
371375
</html>

0 commit comments

Comments
 (0)