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

TIMOB-5824: Android: WebView.evalJS Causes Form Input Fields to Lost/Not Retain Focus #2540

Merged
merged 6 commits into from Jul 13, 2012

Conversation

ayeung
Copy link
Contributor

@ayeung ayeung commented Jul 11, 2012

https://jira.appcelerator.org/browse/TIMOB-5824

To test, please use test case in Jira.

Please run in KS: Base UI > Views > Web Views > Local URL.

Also, run ui test suite in drillbit.

String code = "javascript:_TiReturn.setValue((function(){try{return " + expression
+ "+\"\";}catch(ti_eval_err){return '';}})());";
Log.d(LCAT, "getJSValue:" + code);
synchronized (this) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synchronizing on codeSnippets is safer.

@ayeung
Copy link
Contributor Author

ayeung commented Jul 13, 2012

Code updated, ready for review again.

@rusticphilosopher
Copy link
Contributor

CR/FR in progress

Log.e(LCAT, "Interrupted", e);
// Don't try to evaluate js code again if the binding has already been destroyed
if (!destroyed) {
String code = "javascript:_TiReturn.setValue((function(){try{return " + expression
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that now you do direct eval(code), seems like you don't need 'javascript:' prefix ?

@rusticphilosopher
Copy link
Contributor

Code reviewed. Will accept CR and perform FR once comments Max made regarding the javascript prefix have been addressed.

}

if (destroyed) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

early return

@ayeung
Copy link
Contributor Author

ayeung commented Jul 13, 2012

Code updated.

@mstepanov
Copy link
Contributor

Code looks good. APPROVED

@rusticphilosopher
Copy link
Contributor

Code reviewed and functional test passed. KS tested and looks ok on both V8 and Rhino. Accepted

rusticphilosopher pushed a commit that referenced this pull request Jul 13, 2012
TIMOB-5824: Android: WebView.evalJS Causes Form Input Fields to Lost/Not Retain Focus
@rusticphilosopher rusticphilosopher merged commit 93a4a5f into tidev:master Jul 13, 2012
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

Successfully merging this pull request may close these issues.

None yet

3 participants