-
Notifications
You must be signed in to change notification settings - Fork 186
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
on:select should not trigger when value is set, but rather when value changes #396
Comments
have the same issue / situation. cheers btw, this does not seem to work for me:
|
Yup... that solution will not work. I am setting a store to hold the current value, and check against that. Here is an example:
|
Fixed in v5.0.0-beta.10 Also added |
hey cool thank you :) nitpicking but wouldn't "clearing" also imply a |
@andreasnuesslein thanks. Fixed in v5.0.0-beta.11 |
I am testing and switching to v5 -- great work! Though I am finding that the on:change event is still being triggered when an initial value is set :/ A page load causes the event to fire. I am using the component for two different selects, again for navigation. Only one fires the change event when loading, both have reactive items that take time to load. The only difference I can tell between the two, is the one that fires the event has both optionIdentifier and labelIdentifier set. Let me know if there is any way I can help debug. Otherwise v5 works great! One minor comment... initially the clear button broke things for me as event.detail no longer exists. A simple event.detail?.id fixed this issue, but wondering if detail should still exist? A minor comment. |
I do still have the same issue as well with 5.0.0-beta.11 |
All seems to be working fine now. Gonna close this. REPL Reopen with a REPL example if I've missed something please. Thanks |
have not checked yet, but thanks :) |
Hello, first of all thanks for your work on this component!
I am using this component for navigation, and have found that if value is set on:select is fired. This means that each time this component loads, it fires and causes it to navigate. On the same page the router is smart enough to know not to do anything, but on sub pages, it navigates a way and back to the parent page.
I have solved the issue, temporarily with the following if statement... but have a feeling it might not work down the road.
if (event.detail.id && event.explicitOriginalTarget !== null) { // navigate here }
The behavior, should be that on:select should be fired only when a selection is made by the user, not when a value is set via the component properties, no?
The text was updated successfully, but these errors were encountered: