-
14 Sep 2011 11:31 AM #1
iPad: Scrolling 'below the fold' will disable native magnifier and selecting text
iPad: Scrolling 'below the fold' will disable native magnifier and selecting text
Sencha Touch version tested:
- 1.1.0
- only default ext-all.css
- iOS 4 (on iPad)
- 'Transform: translate3d' will make it unable to use the native text selecting tools (e.g Magnifier) on inputs that is below the fold.
- create a large form, with input fields below the fold
- scroll to an inputfield that is below the fold
- type "Hello World"
- after that try adding "cruel" between the words.
- you can't add "cruel" without deleting World
- Override of functions: onScrollStart() and onScrollEnd() within Ext.util.ScrollView
- Change transform value's into top value's
My dirty override (wont work with all components, works on lists,panels and datepicker):
Code:Ext.override(Ext.util.ScrollView , { onScrollStart: function() { this.showIndicators(); failed = false; var elm = Ext.getCmp(this.scroller.container.id); if(elm !== undefined) { if(elm.renderData !== undefined) { if(elm.renderData.componentCls != "x-picker-slot") { failed = true; } } else { failed = true; } } else { failed = true; } if(failed) { var subclass = this.scroller.el.dom; subclass.style["-webkit-transform"] = "translate3d(0px, "+this.scroller.offset.y+"px, 0px)"; subclass.style["top"] = ""; //console.log('swaped top into transform'); } }, onScrollEnd: function() { this.hideIndicators(); failed = false; var elm = Ext.getCmp(this.scroller.container.id); if(elm !== undefined) { if(elm.renderData !== undefined) { if(elm.renderData.componentCls != "x-picker-slot") { failed = true; } } else { failed = true; } } else { failed = true; } if(failed) { var subclass = this.scroller.el.dom; subclass.style["-webkit-transform"] = ""; subclass.style["top"] = this.scroller.offset.y+"px"; //console.log('swaped transform into top'); } } });Last edited by DragoslaV; 21 Sep 2011 at 2:36 AM. Reason: updated framework to 1.1.0 - same problem
-
19 Sep 2011 5:01 AM #2
better to late then never, the test code:
Code:<!doctype html> <html> <head> <title>Test case - form</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="apple-mobile-web-app-capable" content="yes"> <link rel="stylesheet" href="css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="js/sencha-touch-debug.js"></script> <script type="text/javascript"> Ext.ns('Ext.ux'); Ext.ux.UniversalUI = Ext.extend(Ext.Panel, { fullscreen: true, layout: 'card', items: [{ xtype:"form", scroll: 'vertical', items: [{ xtype: "fieldset", title: "Fieldset", margin: "15 15 40 15", defaults: { labelWidth:130, autoCapitalize: false }, items: [{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Label 1", placeHolder: "some placeholder" },{ xtype: "textfield", name: "whatever", label: "Hello", placeHolder: "Type 'Hello World' after it try adding 'cruel'" }] }] }] }); Ext.setup({ onReady: function() { Ext.mainUI = new Ext.ux.UniversalUI(); } }); </script> </head> <body> </body> </html>
-
20 Sep 2011 2:36 AM #3
Ok update #2. I removed my 'dirty override' because it was giving performance issue's and bugs in other components.
New code, add this on top of your form:
Code:defaults: { listeners: { focus: function() { Ext.changeTransformIntoTop(YourFormPanelVariable,this,false); }, blur: function() { Ext.changeTransformIntoTop(YourFormPanelVariable,this,true); } },It's still a dirty workaround, but scrolling will be more smooth and you can select text.Code:Ext.changeTransformIntoTop = function(subclass,field,removeIt) { if(subclass.scrollEl != undefined) { if(removeIt === false) { subclass.scroller.useCssTransform = false; subclass.scrollEl.dom.style['-webkit-transform'] = ""; subclass.scrollEl.dom.style['top'] = subclass.scroller.offset.y+"px"; //console.log('swap transform with top'); } else { subclass.scroller.useCssTransform = true; subclass.scrollEl.dom.style['top'] = ""; subclass.scrollEl.dom.style['-webkit-transform'] = "translate3d(0px, "+subclass.scroller.offset.y+"px, 0px)"; //console.log('swap top with transform'); } } };
-
10 Oct 2012 7:08 AM #4
Any updates?
Did apple fixed it? is it fixed in Sencha 2?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote