Skip to content

[Input][SuggestionItem]: input event doesn't include selected suggestion item information #11182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
bonnieso opened this issue Mar 25, 2025 · 5 comments · Fixed by #11301
Closed
1 task done

Comments

@bonnieso
Copy link

bonnieso commented Mar 25, 2025

Bug Description

The selection-change event seems to be the only event on the Input component that provides item information for the suggested item. The documentation states that an event is fired when a user navigates to a suggestion item via the ARROW keys, as a preview, before the final selection so the only way to get the item information is through this event. When a mouse user selects a suggestion item, there is no way to capture the information of the suggested item. In v1 of this component, the suggestion-item-select event exposed the item information. Now in v2, there is no way to get the item information of the suggested item that was selected. It is expected that the input event would also include information on the suggested item since it is triggered when a suggestion item has been selected.

Affected Component

Input

Expected Behaviour

Expose the item information on the input event or expose another event similar to suggestion-item-select from v1 of the Input element.

Isolated Example

https://sap.github.io/ui5-webcomponents/components/Input/

Steps to Reproduce

Log Output, Stack Trace or Screenshots

No response

Priority

Very High

UI5 Web Components Version

2.8.0

Browser

Chrome

Operating System

No response

Additional Context

No response

Organization

SAP SuccessFactors

Declaration

  • I’m not disclosing any internal or sensitive information.
@bonnieso bonnieso added the bug This issue is a bug in the code label Mar 25, 2025
@s-todorova s-todorova self-assigned this Mar 26, 2025
@s-todorova
Copy link
Contributor

Hi @bonnieso,

With v2 of Web Components, the suggestion-item-select event has been removed. You can still achieve the same result of getting the suggestion item that was clicked by using a combination of selection-change and change events which is documented in the Migration Guide. You can see a sample of how to do it here.

Best,
Siyana

@s-todorova s-todorova removed the bug This issue is a bug in the code label Mar 26, 2025
@s-todorova s-todorova removed their assignment Mar 26, 2025
@bonnieso
Copy link
Author

Hi @s-todorova ,

You aren't able to achieve the same results of getting the suggestion item as before though because the change events only fire when a selection has changed. In our use case, we would need the event to fire every time a suggestion item is selected like before. So even if the same suggestion item was selected as before, we would still need the event to fire, but with selection-change and change the events don't fire. Can you see if you can help add this functionality back?

Thanks,
Bonnie

@s-todorova
Copy link
Contributor

Hello @SAP/ui5-webcomponents-topic-rl,

Can you take a look at this and consult on how the same behavior as the old suggestion-item-select event can be achieved with the events that are available now?

Problem with the approach described in the migration guide can be observed on the sample here.

  1. Type 'a' and select 'Argentina' for example -> in the console event item is logged
  2. Hit backspace to delete the last letter, suggestions popover opens again, select Argentina again -> item is not logged.

In the old version with the suggestion-item-select event this works and the item is logged on subsequent choosing also, using the same approach as above.

Best,
Siyana

Copy link

This issue has been closed. To reopen, just leave a comment!

@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This issue has been resolved in version v2.10.0-rc.1 🎉

The release is available on v2.10.0-rc.1

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

5 participants