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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use default value for bindable component properties when undefined is passed as a value #1696
Comments
If I am not wrong, the current behaviour is similar to v1. Hence, introducing this behaviour would a breaking change and will potentially break many apps. Also, IMO that is counterintuitive. Currently, if you bind Note that you can always use the |
For backward compat, we can leave it to our compat-v1 package, I think it's ok to focus on the intuitiveness of the behavior: Does it make more sense to ignore first
|
I think this makes sense; for an initial |
馃檵 Feature Request
Consider that we have an CE:
And a usage like this:
outerProperty
is set toundefined
, soSomeComponent.property
will also be set toundefined
, while in JS semanticsundefined
is treated as no value, so a default1
should be used instead.This is related both to initial assignment, and to further
outerProperty
changes.馃 Expected Behavior
When first assigning values to SomeComponent instance,
undefined
values should not be set, so that default values are left untouched.On further
outerProperty
value changesBindableObserver
should check if new value is undefined and set a default in that case. Default values could be cached (may be in metadata) after viewModel invocation.馃槸 Current Behavior
undefined
is passed to bindableshttps://discord.com/channels/448698263508615178/545423969642217474/1007215994248384523
馃拋 Possible Solution
馃敠 Context
馃捇 Examples
The text was updated successfully, but these errors were encountered: