SAP / openui5

OpenUI5 lets you build enterprise-ready web applications, responsive to all devices, running on almost any browser of your choice.
http://openui5.org
Apache License 2.0
2.9k stars 1.23k forks source link

sap.m.Input suggestionItems not shown as soon as they are added #4051

Closed tylervz closed 1 week ago

tylervz commented 1 month ago

OpenUI5 version: 1.71.45, 1.71.65, 1.71.68

Browser/version (+device/version): Chrome Version 125.0.6422.61 (Official Build) (x86_64) (Mac OS 13.6.6)

Any other tested browsers/devices(OK/FAIL): Firefox 126.0 (64-bit) (Mac OS 13.6.6) FAIL

URL (minimal example if possible): https://stackblitz.com/edit/web-platform-1h44nr?file=view%2FApp.view.xml

Steps to reproduce the problem:

  1. Enter 'mari' in one of the two sap.m.Inputs in the table.
  2. No suggestionItems are shown, despite them being added via the controller.
  3. Add a fifth character to the input so now it says 'mario', and suggestionItems will be shown.

What is the expected result?

The API results should be shown as suggestionItems when 'mari' is entered because the handleObserverSuggest function in the controller is adding suggestion items:

oInput.addSuggestionItem(
    new sap.ui.core.ListItem({
        text: oData.amiibo[i].character,
    })
);

What happens instead?

No suggestionItems are shown. suggestionItems are only shown once a fifth character is entered.

Any other information? (attach screenshot if possible)

I've noticed that if you quickly type 'mari' or paste that into an input, then suggestionItems do get shown.

I know the issue has been fixed in OpenUI5 1.108.29, but upgrading our application would be a large effort.

image

image

plamenivanov91 commented 1 month ago

Hello @tylervz ,

Thank you for sharing this finding. I've created an internal incident DINC0164600. The status of the issue will be updated here in GitHub.

Regards, Plamen Ivanov

MapTo0 commented 1 week ago

Hello @tylervz

Unfortunately, I could not reproduce the issue. Could you please update to latest browser versions and recheck it? I've tried to

All the cases above work.

I've tested on FF / Chrome on Mac and Windows.

My proposal for you is to use the startSuggestion API set to 4 since this looks quite custom and we have already provided API for that use case. Could you please try and give us feedback?

tylervz commented 1 week ago

Hi @MapTo0

I was still able to reproduce the issue after updating both Chrome and Firefox.

However, adding startSuggestion="4" to the sap.m.Input fixes the issue! Thank you for looking into this and providing such helpful feedback!