Bug on UI Builder 'On Change Event'

We are using this logic to auto populate a search box from a database:

Sometimes when the user types fast, the search comes out wrong

I can DM you a video of it happening

Hello @Andreas_Marinopoulos!

Could you please add a video?

Regards,
Alexander

I will DM it to you on Slack as it contains a sensitive url

Thank you, I watched your video, I have an idea of what might be the issue.
But I need more information, could you please print in the console the responses you get when you enter a search query? (You can DM it to my Slack)

Regards,
Alexander

About the error:
It most likely occurs when there are no search results.
This is where you should check if the object exists before accessing its properties.

About wrong search results:
To solve this problem, you should add a delay before sending the request (debounce).
This will also reduce the number of calls to the database.

My colleague in this topic has described solutions:

I also created an internal ticket BKNDLSS-30427 to discuss adding such a feature for the Input component.

I’ll keep you updated on the progress.

Regards,
Alexander

Thanks Alexander, we will try to do this and revert.

1 Like