lopespm / mobiscroll

Automatically exported from code.google.com/p/mobiscroll
1 stars 0 forks source link

Resize on orientationchange causes some phone browsers to crash #116

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Using code similar to this:

function createDatePicker(selector){
            var scrollWidth = ($("div[id='main_content']").width())  / 4;
            var scrollHeight = scrollWidth / 2.5;
            $("#input_" + selector).scroller('destroy');
            $("#input_" + selector).scroller({
                    preset: 'date',
                    minDate: new Date(2000, 0, 1),
                    maxDate: new Date(2020, 11, 31),
                    theme: 'android',
                    display: 'inline',
                    mode: 'scroller',
                    dateOrder: 'mmddyy',
                    width: scrollWidth,
                    height: scrollHeight,
                    onChange: function (valueText, inst) {
                        var lbl = $("#lbl_" + selector);
                        var date = $("#input_" + selector).scroller('getDate');
                        lbl.text(date.toDateString());
                    }
                });
        }

function setDatePickerWidthAndHeight()
 { 
    var scrollWidth = ($("div[id='main_content']").width()) / 4;
    var scrollHeight = scrollWidth / 2.5;
    var selectorBase1 = "date_1";
    $("#input_" + selectorBase1).eq(0).scroller('option', 'width', scrollWidth);
    $("#input_" + selectorBase1).eq(0).scroller('option', 'height', scrollHeight);
 }

 $(function () {
 $(window).bind('orientationchange', function (event) {
                setTimeout(setDatePickerWidthAndHeight(),100);
            });
 }

What is the expected output? What do you see instead?

Expected:
The control's width and height will be changed on orientationchange.

What happens:
After a few orientation changes the browser becomes sluggish and on some phones 
the browser will eventually crash.

What version of the product are you using? On what operating system?

Version 2.2.
Crashes on Android 2.1 at least.

Please provide any additional information below.

Original issue reported on code.google.com by j...@qsronline.com on 3 Dec 2012 at 5:56

GoogleCodeExporter commented 8 years ago
It seems to only happen if I change orientation, scroll up or down, then change 
orientation again.... If I do not scroll up or down then I can change 
orientation several times.... I did 20 w/o any problems.... but If I change 
orientation once, scroll up and/or down, change orientation... then it crashes 
the browser.

Original comment by j...@qsronline.com on 3 Dec 2012 at 6:16

GoogleCodeExporter commented 8 years ago
Maybe this has nothing to do with mobiscroll.

Original comment by j...@qsronline.com on 3 Dec 2012 at 6:16

GoogleCodeExporter commented 8 years ago
This also happens if I tap the address bar then hit the back button to back to 
the page and hide the key pad......... a page crash occurs.... does not happen 
on pages that do not have mobiscroll.

Original comment by j...@qsronline.com on 4 Dec 2012 at 6:31

GoogleCodeExporter commented 8 years ago
Looks like this isn't a mobiscroll issue:
http://stackoverflow.com/questions/13710834/problems-with-mobiscroll-orientation
change-and-access-address-bar-crashes-some

Thanks for the research and answer

Original comment by diosla...@gmail.com on 10 Dec 2012 at 8:08