Crashalot
Crashalot

Reputation: 34523

Crashing Safari on iPhone 4/4s (iOS 7.0.1) when zooming in on text input field (and only when zooming)

Safari crashes consistently on an iPhone 4/4s running iOS 7 when zooming in on a text field on our site. Our site works fine on an iPhone 5 and on desktops.

To reproduce:

1) Visit www.panabee.com from an iPhone 4/4s.

2) Run a search with two terms (e.g., "stackoverflow rocks").

3) After the results page loads, zoom into the search field at the top. Adjust the search terms. Safari crashes. You must zoom. If you adjust the search terms without zooming, the site works fine.

The following jQuery code executes upon editing the text field:

function text_field_onclick( field ) {
    field = $( field );
    if ( field.hasClass('tip') ) {
        field.removeClass('tip');
        field.val( '' );
    }
}


function text_field_onblur( field ) {
    field = $( field );
    if ( !field.val() ) {
        field.addClass('tip');
        field.val( field.attr('tip') );
    }
}

Why is Safari crashing? Is it something with our site?

Upvotes: 5

Views: 628

Answers (2)

Friedrich
Friedrich

Reputation: 2300

The Problem is indeed a memory-problem, the only way to remove crashes, is to improve the pages performance. I recommend to use the full build page and then start to remove parts out of it one by one, until you are at the point where the page works fine.

In this blogpost the author describes, that removing one single comment can make the bug disappear.

This whole process is really painfull, but there is yet no other possibility for debugging this type of error.

Also Note: In development-mode, the Browser itself has less memory for rendering and page performance. So turning development off can make a big difference.

Upvotes: 0

Dipen Chudasama
Dipen Chudasama

Reputation: 3093

This has happened because of "low memory", this is a memory issue.The iPhone5's memory is larger than iPhone4's and iPhone4s's. That's why this does not happen on the iPhone5 . This is a performance issue. Please improve your application's performance or solve the memory issue. Maybe in your application, some functions are using more memory and thats why this happens.

Upvotes: 0

Related Questions