component / reactive

Tiny reactive template engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'data-value' use el.value replace el.setAttribute

brighthas opened this issue · comments

var attrs = [
    ...
    // remove value
    ...
];


bind('data-value', function(el, name){
      this.change(function(){
        el.value = this.interpolate(name);
      });
 });

why ? because when we write content at input element , then setTimeout execute el.setAttribute("value","xxx") cann't update UI view.

This works for me too.
setAttribute doesn't update modified input fields. It updates the dom but not the view.

Tested with chromium 27.0.1453.93.

Would we want component/value instead to get it to work with selects? or does setting el.value work for selects and stuff?

I think using a proper working component/value would be the best thing.
I dont know if works with the different input types.

Can you please provide a failing example/test? I am having a hard time following what your issue is and what you expect the correct behavior to be.