Skip to content

Commit

Permalink
fix(ui5-input): stop firing focusout on suggestion click (#1857)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ilhan007 committed Jun 23, 2020
1 parent 0153b32 commit a33dd95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/main/src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ class Input extends UI5Element {
// if focusout is triggered by pressing on suggestion item or value state message popover, skip invalidation, because re-rendering
// will happen before "itemPress" event, which will make item "active" state not visualized
if (focusedOutToSuggestions || focusedOutToValueStateMessage) {
event.stopImmediatePropagation();
return;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/main/test/pages/Input.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ <h3> Input with multiple icons</h3>
quickViewCard.close(false, true, true);
});
});

inputPreview.addEventListener("focusout", function (event) {
console.log("focusout");
});
</script>
</body>
</html>

0 comments on commit a33dd95

Please sign in to comment.