-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
[fetch] Allow create options from initial value #71
Comments
When in init mode, svelecte loads the optionlist, after that, the item with the key should be selected. Currently we must set key and value to show a pre-selected item. But normally you store the setting (a key) and not the value. Example: Load a user from database and got his country-iso-code "DE".
Svelecte should set the selected option only by key after init (or by key from object if use At the moment it works only with Without |
Yes, this use case is totally valid. I didn't know back then how to solve it properly. But as I thought about it today, it turns out, that solution can be pretty easy, soon will publish new version with the update. |
Thank you. Have 2 smaller suggestions: When fetchMode is When set it manually to disabled and fech is still loading the loading spinner is invisible. |
Spinner is visible even when disabled. BUT when Not sure if I will be able to achieve both funcionalities at the same time I do it that when parent value changes, child svelecte is enabled and fetching and when options are received (listenting to |
Here is a small example: https://svelte.dev/repl/4facb61cc3ed47bba72c80a5256f230d?version=3.46.2 It disables by default and simulates a 3 second fetch. After fetch it will be enabled. No spinner is visible while fetching, but fetch is running. Ok, when you handle it as abort it is clear that no spinner is visible. The abort und disabled functionality should better be separated. |
Can be desirable to init svelecte with initial value when we have fetch
indefined.init
modeTypical use-case would be dependent svelecte and previous search with stored value.
[update 2022-01-25]
Should work only conjunction withvalueAsObject
propertyOf course it should work also with
init
fetch mode, in which case, value setter will be delayedThe text was updated successfully, but these errors were encountered: