Rajohn
Rajohn

Reputation: 49

On touch event for select is not working in android devices with angular material js

main.controller.js

     app.directive('appStart', function(){
     return {
            restrict: 'E',
           templateUrl: 'templates/1.html?ed'
         }
        });

    app.controller('MainController', ['$scope', '$sce', '$http', 'Spotify', '$cookies', '$mdDialog', function ($scope, $sce, $http, Spotify, $cookies, $mdDialog) {


     this.etInfo = etInfo;


   }

1.html#

      <select ng-model="etInfo.show" name="show" ng-init="etInfo.show = etInfo.show || ''">
              <option value="">Please choose:</option>
              <option val="Jan05">Jan 05 - chennai</option>
              <option val="Jan07">Jan 07 - Mumbai</option>
        <select>

In the above code, i just try to store the selected value of select input from external html 1.html into etInfo value inside main.controller.js. Please help me to get the select option data to the variable.

The reason am trying to store is the onclick event for select option is not working in android devices. because angular.material.js is overiding the angular.js mousedown event. How to bypass it.

Upvotes: 1

Views: 1134

Answers (1)

Maxime Valy
Maxime Valy

Reputation: 113

You can disable the click events hijacking as follows:

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

For some reason it seems to be problematic on mobile when jQuery is not present https://github.com/angular/material/blob/72b4f10/src/core/services/gesture/gesture.js#L32

Upvotes: 3

Related Questions