[TIMOB-12891] iOS: Font size in webview growing after adding click event listener
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-03-26T22:03:03.000+0000 |
Affected Version/s | Release 3.0.2 |
Fix Version/s | 2013 Sprint 07 Core, 2013 Sprint 07 |
Components | iOS |
Labels | ios, titanium, triage, webview |
Reporter | Carter Lathrop |
Assignee | Max Stepanov |
Created | 2013-02-26T00:35:45.000+0000 |
Updated | 2017-03-22T18:29:01.000+0000 |
Description
*Problem*
Under certain conditions the text in said webviews seems to grow about 3x for no apparent reason.
*Steps to Reproduce*
1. Paste provided code into app.js
2. Run code in iOS simulator
3. If you go scroll down, the text size in the first row will increase to about 3 times larger.
The second row is the same except there is no event listener attached and the problem doesn't occur.
The third row is slightly different as it only has 1 element in it but it has an event listener attached and the problem does not occur.
In the main project where I first discovered this bug I could trigger it by adding "style='margin-left:20px'" to a
- that had at least a few
- 's in it as it seems this bug doesn't occur when only 1
- is involved.
*Test Case*
var win = Ti.UI.createWindow(); var row = Ti.UI.createTableViewRow({ height: 200 }); var row2 = Ti.UI.createTableViewRow({ height: 200 }); var row3 = Ti.UI.createTableViewRow({ height: 200 }); var parent = Ti.UI.createView({ height: Ti.UI.SIZE, width: Ti.UI.FILL, layout: 'vertical' }); var parent2 = Ti.UI.createView({ height: Ti.UI.SIZE, width: Ti.UI.KILL, layout: 'vertical' }); var parent3 = Ti.UI.createView({ height: Ti.UI.SIZE, width: Ti.UI.KILL, layout: 'vertical' }); // This one bugs out var webview = Titanium.UI.createWebView({ disableBounce: true, height: 200, width: Ti.UI.FILL, html: "<div id='subtext'><ul><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li></ul></div>" }); // This one is the same except no event handler was attached, does not bug out var webview2 = Titanium.UI.createWebView({ disableBounce: true, height: 200, width: Ti.UI.FILL, html: "<div id='subtext'><ul><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li><li>Assess the victim and treat any injuries or illness<\/li></ul></div>" }); // This one has an event handler but with only 1 <li> element it doesn't seem to affect it for some reason var webview3 = Titanium.UI.createWebView({ disableBounce: true, height: 200, width: Ti.UI.FILL, html: "<div id='subtext'><ul><li>Assess the victim and treat any injuries or illness<\/li></ul></div>" }); webview.addEventListener('click', function(){ // Some Code }); webview3.addEventListener('click', function(){ // Some Code }); parent.add(webview); parent2.add(webview2); parent3.add(webview3); row.add(parent); row2.add(parent2); row3.add(parent3); var table = Ti.UI.createTableView({ data: [row, row2, row3] }); win.add(table); win.open();
Attachments
File | Date | Size |
---|---|---|
Bug.zip | 2013-02-26T00:35:45.000+0000 | 3703645 |
Confirmed bug behavior, tested on iOS simulator (6.0) with Ti SDK 3.0.3.v20130219140159.
Is there any kind of fix/workaround/update for this issue yet?
Use of WebViews inside TableRows are generally not recommended for various reasons. Workaround: remove vertical layout and use absolute values for WebView width/height.
Closing ticket as the issue will not fix and with reference to the above comments. A workaround has been provided above.