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

Form Inputs in fixed navbar breaks it on iOS 7 #11805

Closed
gastonmorixe opened this issue Dec 9, 2013 · 6 comments
Closed

Form Inputs in fixed navbar breaks it on iOS 7 #11805

gastonmorixe opened this issue Dec 9, 2013 · 6 comments

Comments

@gastonmorixe
Copy link

Hi guys,

I think this issue is the same as issue #9757.

I reproduced it on iOS 7, just having an input on the navbar if the scroll is not at the top, at the moment the keyboard appears, the navbar goes down the same amount the scroll was at.

Thanks.
Ton.

@cvrebert
Copy link
Collaborator

I think this is the same issue that we currently mention in the context of modals: http://getbootstrap.com/getting-started/#mobile-modals

@gastonmorixe
Copy link
Author

@cvrebert you are right, didn't notice that. Should this be closed or can we came up with a solution?

@cvrebert
Copy link
Collaborator

I think we should document it for navbars like we already do for modals.

@gastonmorixe
Copy link
Author

Ok. Just for the record of someone looking at this issue, this is the solution I am using right now and is working properly.

JS/coffee

# iOS FIXED FIX
if Modernizr.touch
    $body = $('body')
    $(document).on 'focus', 'input', (e)->
        $body.addClass('fixfixed')
        setTimeout =>
            $(document).scrollTop($(this).scrollTop())
        , 10
    $(document).on 'blur', 'input', (e)->
        $body.removeClass('fixfixed')

and then in the css/sass

body
  &.fixfixed
    #YOUFIXEDRELEMENT
      position: absolute

@mdo mdo closed this as completed in 61ec569 Dec 15, 2013
@gastonmorixe
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants