-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix for hasFocus / checked binding if not applied via DataBindProvider #208
base: main
Are you sure you want to change the base?
Conversation
Problem: An observable would not fire if the foucs / checked state changed if the binding was not applied via the databindProvider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! I know it was not easy to find.
@brianmhunt: I was involved in developing this solution. If this PR is okay for you, we can merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you. A few stylistic changes, and I think we want to avoid a jQuery dependency here (unless we're testing positively for things using jQuery, but that doesn't seem to be the case here). It'd be good to not introduce more var
statements, since they hoist and collide, introducing the possibility of unexpected side effects.
Please share if you have any comments/questions/thoughts, and I'll keep an eye out for updates. Thank you!
Thanks @brianmhunt ! i changed the mentioned code |
@brianmhunt mcselle made all requested changes. Can I merge it now? |
Problem
Testcase
Fix
Found this bug while migrating from ko to tko, we have a custom LegacyBinding that applies bindings itself.
So its not a
DataBindProvider
which would otherwise triggerParser.ConvertToAccessor()
and therefore override thevalue
function.I guess after #202 is merged it would be best to migrate the hasFocus / checked / etc. Bindings like the
value
Binding which already inherites fromBindingHandler
that basically contains the same logic as my quick fix