sourcebitsllc / chocolatechip-ui

Mobile Web App Framework
www.chocolatechip-ui.com
MIT License
617 stars 88 forks source link

Search in nav bar on ios #42

Closed sandwichfeet closed 10 years ago

sandwichfeet commented 10 years ago

It's not possible to have a search input in the navbar on ios due to rubber banding prevention stopping the event passing through to the input field.

Not sure if this is the best way to do it, but I've been using the following in navigation.js ...

  /////////////////////////////////////////////////////////
  // Stop rubber banding when dragging down on nav:
  /////////////////////////////////////////////////////////
  $('nav').on($.eventStart, function(e) {
      if ( ! $( e.target ).is('input') ) {
          e.preventDefault();
      }
  });
sourcebits-robertbiggs commented 10 years ago

I’m just prototyping out a search widget as a separate search bar like on iOS, so the search input won’t actually reside in the navbar. But this sounds like a good workaround for your use case.

Product Director ChocolateChip-UI

San Francisco

On Jan 19, 2014, at 7:30 PM, sandwichfeet notifications@github.com wrote:

It's not possible to have a search input in the navbar on ios due to rubber banding prevention stopping the event passing through to the input field.

Not sure if this is the best way to do it, but I've been using the following in navigation.js ...

///////////////////////////////////////////////////////// // Stop rubber banding when dragging down on nav: ///////////////////////////////////////////////////////// $('nav').on($.eventStart, function(e) { if ( ! $( e.target ).is('input') ) { e.preventDefault(); } }); — Reply to this email directly or view it on GitHub.