Skip to content
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 with Knockout value driven area #35

Closed
grofit opened this issue Jul 10, 2015 · 4 comments
Closed

Issue with Knockout value driven area #35

grofit opened this issue Jul 10, 2015 · 4 comments

Comments

@grofit
Copy link

grofit commented Jul 10, 2015

I was using once before every time an update happened which was fine, but I thought it would probably be easier to use live, but it doesnt update.

The element its targeting is driven by a knockout observable like so:

<div id="preview" data-bind="text: someTextObservable"></div>

So that div will change its content every time someTextObservable changes, now I notice in the source code that it is looking for key pressed based events, whereas in this case those would not apply as its a div not an input.

I know there are some events for mutations part of the newer html spec so not sure if you are fussed about supporting them or not, I can go back to just using once whenever it updates which is fine, but just wanted to raise this incase you wanted to extend support.

@RadLikeWhoa
Copy link
Owner

I'll have to look into this for a bit as I'm not too familiar with Knockout. I'll get back to you as soon as I can.

@grofit
Copy link
Author

grofit commented Aug 14, 2015

No rush, in this case it just provides observable objects so you can subscribe to them, like

var observableValue = ko.observable(20);
observableValue.subscribe(function(newValue) { stuffChanged(); });
observableValue(30); // this triggers stuffChanged

@RadLikeWhoa
Copy link
Owner

I'd love to get this to work, but I feel like it'd require quite a bit of code for a (probably) rather uncommon use case. I get why you'd want the functionality, but in the end, leaving the events delegated to Knockout and then doing the update separately using Countable should work best. I'll close this for now.

@grofit
Copy link
Author

grofit commented Sep 23, 2015

Thats cool, thanks for looking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants