Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular material: loose focus with clicking out an input

Tags:

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?

like image 254
Rolintocour Avatar asked Jul 13 '16 15:07

Rolintocour


1 Answers

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.

like image 86
Jodo Avatar answered Sep 28 '22 03:09

Jodo