modus-web-components icon indicating copy to clipboard operation
modus-web-components copied to clipboard

Autocomplete : Need to persist selected option during orientation change and the user session

Open anwishaZ opened this issue 1 year ago • 1 comments

Prerequisites

Describe the issue

Our application uses the valueChange event to fetch autocomplete options from an API call. Each input change triggers an API call within the valueChange method to retrieve the options that need to be displayed.

Requirement: When the device orientation changes or the user navigates back to the screen, the selected option in the autocomplete component must be preserved.

Approach: We retrieve the selected option from our application's service and set it as the value of the autocomplete component.

Observations: However, setting the value in this manner triggers the valueChange event, which in turn initiates an API call. This behavior complicates the process of setting the selected option without causing an additional API call

Reduced test cases

No response

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome, Microsoft Edge

What is the issue regarding ?

@trimble-oss/modus-web-components

What version of npm package are you using ?

@trimble-oss/modus-web-components": "^0.40.0"

Priority

High

What product/project are you using Modus Components for ?

Trimble forestry

What is your team/division name ?

Central Product Development

Are you willing to contribute ?

Maybe

Are you using Modus Web Components in production ?

Yes

anwishaZ avatar Nov 29 '24 09:11 anwishaZ

Hello @anwishaZ! Thanks for opening an issue. The Modus core team will get back to you soon (usually within 24-hours) and provide guidance on how to proceed. Contributors are welcome to participate in the discussion and provide their input on how to best solve the issue, and even submit a PR if they want to.

Please wait until the issue is ready to be worked on before submitting a PR, or you can reach out to the core team if it is time bound. For trivial things, or bugs that don't change the expected behaviors and UI, you can go ahead and make a PR.

github-actions[bot] avatar Nov 29 '24 09:11 github-actions[bot]