BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
855 stars 130 forks source link

data-link to an array.length is not observed by WebView on Android #308

Closed eugene-panferov closed 9 years ago

eugene-panferov commented 9 years ago

sorry for confusing header, it is hard to formulate in a natural language. hopefully i put enough keywords in it.

the environment is: LG Nexus 5 / Android 5.1 / WebView + Apache Cordova 5.0 + jsviews (master, downloaded right now)

the observed symptom is: i do "observably" insert an item into the array, and the DOM object ("data-linked" to this array's length) does not respond. while the DOM object "data-linked" with "for" to the content of the same array responds properly.

the setup is:

No games open

// JS on some event does: $.observable(Games).insert({name:"xyz",rating:"123"});

before the operation Games is empty, and "No games open" is visible. after the operation it is still visible.

exactly this code snippet is working perfectly for many months on the desktop browsers.

BorisMoore commented 9 years ago

It is difficult for me to test this. Can you create a small jsfiddle - or show me the template markup and code for a small example?

Is it still working on the desktop browser, but not on your Android device?

Can you try to simplify the example and debug what is happening on the Android device? Is the javascript raising an exception? Or is this an HTML DOM issue? Either the javascript or the HTML DOM rendering and behavior must be different in the Android/Web View environment from the desktop browser....

Will the simple examples shown here http://www.jsviews.com/#jsvplaying work on your Android device?

eugene-panferov commented 9 years ago

I AM DEEPLY SORRY! i have posted you the exact example and this fucking stupid github has stripped it off completely. I did not notice that until now.

this is why i always prefer normal humane e-mails.

eugene-panferov commented 9 years ago

sorry for the late reply, i was waiting for e-mail notification which never occurred.

jsfiddle will not help, because the effect is located inside Cordova environment. so, i am going to create a minimal Android application that demonstrates the effect and share it with you.

answering your questions: the same JS code works fine in desktop env. when it fails to update DOM no exception is thrown.

eugene-panferov commented 9 years ago

I need to apologize once more. i have finished the example, and in parallel, upgraded everything on my android. after the upgrade the effect disappeared, and the .length became observable as expected.

BorisMoore commented 9 years ago

OK - thanks for checking...