Rolintocour Rolintocour - 1 month ago 10
AngularJS Question

Angular material: loose focus with clicking out an input

Using angular and material design, I notice that, when you focus an input and then click outside (on nothing particular):


  • on desktop, the focus is removed from the input

  • on mobile (android), the focus stays



This is really annoying on mobile, because having an md-autocomplete that is focused, the virtual keyboard slides up and take half of the available height. And there is no way to hide it, except to click on another field or a button!

I really can't understand why the mobile shouldn't behave like the desktop. Is there no way to loose the focus when the user clicks outside or select an element?

Answer
app = angular.module('App', ['ngMaterial'])
  .config(function( $mdGestureProvider ) {
      $mdGestureProvider.skipClickHijack();
  });

I know this is already years old question, but in case anyone is the same problem. The $mdGestureProvider.skipClickHijack() worked for me.