From a33dd956fe7ad9774971031c436ef0b8214d3e2e Mon Sep 17 00:00:00 2001 From: ilhan orhan Date: Tue, 23 Jun 2020 17:58:33 +0300 Subject: [PATCH] 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 --- packages/main/src/Input.js | 1 + packages/main/test/pages/Input.html | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/main/src/Input.js b/packages/main/src/Input.js index e45f8aed2e81..e9a13a0f0cea 100644 --- a/packages/main/src/Input.js +++ b/packages/main/src/Input.js @@ -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; } diff --git a/packages/main/test/pages/Input.html b/packages/main/test/pages/Input.html index 07f0df84a297..857cefe0e510 100644 --- a/packages/main/test/pages/Input.html +++ b/packages/main/test/pages/Input.html @@ -366,6 +366,10 @@

Input with multiple icons

quickViewCard.close(false, true, true); }); }); + + inputPreview.addEventListener("focusout", function (event) { + console.log("focusout"); + });