-
Notifications
You must be signed in to change notification settings - Fork 6
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
Issue when setting option values via function #52
Comments
Thanks for the catch @MasterPuffin. Please try v11.0.3 - it must be fixed there. Unfortunately I cannot see more reliable workaround than mutation observer. It's specific case of selects - they automatically change own value if children added/changed/removed, and no Watch out: state gets updated in a tick. |
The issue is fixed wirh 11.0.3.
It has to be this complex, because, as you mentioned, the update happens after one tick. |
Have you tried without delay @MasterPuffin ? It should not force you to do that, it should just work. |
I just tested it again to make sure, but without the delay it doesn't work for me. |
Hmm, that's not a way to go. Is that the test-case above? Would you be able to write basic example when it fails? I will try to make it sync if that's indeed the cause. |
I managed to reproduce the issue in a test case
I use the latest sprae.umd.min.js without any other code, if that matters. |
Can you elaborate this part: if (!object.defaultmode) {
(async () => {
await new Promise(resolve => setTimeout(resolve, 0));
state.object.defaultmode = null
})();
} What are you trying to achieve/test here? Normally it's supposed Also - I've updated to v11.0.4 with better mutation observer init order, IDK if it will make difference but you can test. |
Hello,
I found another issue:
I have an object where I use one value for a select field. When the value is set to null and initializing sprae, the dropdown is empty. When I now set the available values to an empty array and then push entries to the available values via a function, now the dropdown has selected a value. However if I now read from the original object the value set by the dropdown is still null.
Please see the following example code to reproduce this issue
The text was updated successfully, but these errors were encountered: