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

Reproducible crash on iOS9 when input field in modal header #320

Open
pors opened this issue Sep 24, 2015 · 2 comments
Open

Reproducible crash on iOS9 when input field in modal header #320

pors opened this issue Sep 24, 2015 · 2 comments

Comments

@pors
Copy link

pors commented Sep 24, 2015

On iOS is it recommended by Apple to place the input field for search in a modal in the header. This makes sense as it makes better use of the space, and also because the search box stays into view when scrolling through the results.

Starting with the latest version of meteorhunt I modified templates/modals/search/search.html as follows:

<template name="search">
  {{#ionModal customTemplate=true}}
  <div class="bar bar-header bar-stable">
    <label class="item-input-wrapper">
      {{> ionIcon icon="ios-search" class="placeholder-icon"}}
      <input type="text" placeholder="Search" value="{{searchQuery}}">
    </label>
    <button class="buttons button button-clear nav-branding" data-dismiss="modal"><i>Close</i></button>
  </div>
  <div class="content has-header overflow-scroll">
    <div class="group no-padding">
      {{#each products}}
      {{> _productItem product=this path="products.show"}}
      {{/each}}
    </div>
  </div>
  {{/ionModal}}
</template>

The web versions works as should, and the ios simulator as well.

On a real device (iPhone 6, iOS 9) accessing the search function (tap in input bar) makes the app crash (sometimes). This is a bit of the Xcode output:

2015-09-24 19:00:51.507 MeteorHunt[2860:1170596] This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
.
.
.
2015-09-24 19:00:51.515 MeteorHunt[2860:1170596] *** Assertion failure in -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3505.16/UIApplication.m:1697
2015-09-24 19:00:51.519 MeteorHunt[2860:1170596] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'

Please let me know if and how I can help debug this further.

PS I'm a big fan of Meteoric, thanks for the awesome work!

@pors
Copy link
Author

pors commented Sep 26, 2015

Workaround that seems to work (hack):

Add a class to the modal:

  {{#ionModal customTemplate=true class="search-box"}}

that adds some top margin:

.search-box {
    margin-top: 20px;
}

@pors
Copy link
Author

pors commented Oct 2, 2015

Might be related to ionic-team/ionic-framework#4402

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

No branches or pull requests

1 participant