Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Bindings made directly to an input's value property don't function #14

Open
sorvell opened this issue Apr 9, 2014 · 1 comment
Open

Comments

@sorvell
Copy link

sorvell commented Apr 9, 2014

<input value="{{foo}}"> works.

however, if I have this model, where the input property is a reference to the element:
model = {input: input};

a binding to input.value does not work:

<div>{{input.value}}</div>

Can this be fixed?

@rafaelw
Copy link
Contributor

rafaelw commented Apr 9, 2014

This question is equivalent to:

can changes in the value of input nodes' value property be observed by a PathObserver?

The answer is presently: no. Long term, form node values probably should Object.getNotifier(node).notify(), but it's not obvious to me there's a great way to polyfill this. E.g. having to inspect whether all objects along an observed path are input nodes is likely to slow down all observations in a way which probably isn't worth the trade off.

My suggestion is the same as adams. Create an intermediate object and bind input.value to it. Then bind that object to some place else.

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

No branches or pull requests

2 participants