Skip to content
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

Force the "scrollToIndex" when using setValue #263

Open
mjesteve opened this issue Jun 28, 2023 · 2 comments
Open

Force the "scrollToIndex" when using setValue #263

mjesteve opened this issue Jun 28, 2023 · 2 comments

Comments

@mjesteve
Copy link

Hello, I have a doubt,... I am using the control in list mode, with the option "keepAlwaysOpen", but I have a problem that I don't know how to solve: when I set the value that I need to see selected, the list does not scroll to it.

Here is a visual example (as you can see, when I set the value 023, the list does not scroll to its position to make it visible)

GIF 28-06-2023 10-15-14

Is there any way to force the "scrollToIndex" when using setValue?
The behavior I expect is the same as observed when the list is opened, in "Select" mode, and positioned:

GIF 28-06-2023 10-29-23

Is there any way to force the "scrollToIndex" when using setValue?
Thx.

@mjesteve
Copy link
Author

mjesteve commented Jun 29, 2023

I have updated to the latest version, 1.0.39. I have seen the new options: focusSelectedOptionOnOpen; I have activated them but I see no difference in the behavior, using keepAlwaysOpen should these options solve my problem?

Thx.

@mjesteve
Copy link
Author

To add this behavior I have modified the setValueMethod method like this:

image

The result is as expected but it may not be the best after doing it... could you give me your opinion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant