Prevent autofocus on input in modal?

I have a modal slide up and it contains some inputs. Unfortunately, the first one is autofocused causing the iOS keyboard to pop open. But it doesn’t function very well, so I’d like to disable the autofocus. How can I do that?


Hey @jprichardson, I just changed the default on this to be false instead of true, since I agree it’s a bit wonky. Pull from master to see those changes. Here’s the commit:

Perfect! I’m still using 0.9.10 because I’m scared to upgrade until the alpha of my app is completed and tests are in place. From your change, I learned that I could just do this:

Modal.fromTemplateUrl('modal.html', function(modal) {
  $scope.modal = modal
}, {focusFirstInput: false})


Okay great. Just note that the version in master now has much better scrolling, so maybe that’ll be a reason to upgrade :slight_smile:

has this been fixed? why i still have this problem with beta 4.
and, even I add the config like following, the keyboard still auto focus on my first input and the pop up.

        $scope.mdl_new_frontline = modal;
        scope: $scope,
        focusFirstInput: false,
        animation: 'slide-in-up'