-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
[bug] ListApi
doesn't update consistently
#547
Comments
Can you share a minimum code or an environment to reproduce the issue? It looks a bit complicated. Simplifing a problem would be helpful to figure out a cause. |
Sure! Here is a minimum reproduction: https://stackblitz.com/edit/vitejs-vite-zyepfu?file=src%2Fmain.ts If you select "Option B", the list element will still say "Option A". |
Also experiencing this issue, but seeing better performance when the .on('changed') event listener is not added, and no updating when I add the event listener. |
I am encountering the same issue. Here is a workaround I've been using: // Without the bug, you only need this line
listBlade.value = newValue;
// Extra logic to manually update the HTML element
const [selectElem] = listBlade.element.getElementsByTagName('select');
selectElem.selectedIndex = listBlade.options.findIndex((e) => e.value === newValue); |
Came here to share the fix that @DarkLight1337 mentioned. I've found I need to run that logic once after creation if the default value's index is anything other than 0. Additionally adding the logic to the |
I wonder if this is caused by the fact that the Perhaps a potential solution could be to check the Though this doesn't explain why the |
Thank you for sharing details! Very helpful. This seems to be caused by converting an object to a string as you said. Here is the line:
The current ListBladePlugin only supports primitive values (string, number, boolean) because of its implementation. I think additional option like |
Ah, I understand your idea and its direction looks good. Trying to fix the problem... |
Just published the latest version 3.1.10. Could you try this version? |
The repro is fixed! https://stackblitz.com/edit/vitejs-vite-zyepfu?file=src%2Fmain.ts Awesome work!! Thanks @cocopon 🙏🏽 I'll update my larger projects later today to try this out! |
Often times, making a selection on a list blade will result in the change event being called, but the text won't properly update to show the newly selected option's text value.
This code:
The problem typically goes like this:
SongA
SongB
SongB
loads, but the input still showsSongA
as selectedSongB
againSongB
doesn't load again, but the input does correctly update to showSongB
SongA
SongA
loads, and the input updates correctly.SongB
SongB
loads, but the input still showsSongA
as selectedI've noticed this behavior a lot, and I'm wondering if it's a bug or if it's something I'm doing wrong?
The text was updated successfully, but these errors were encountered: