Skip to content

prevent showing popup if disabled #168

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/ion-autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ angular.module('ion-autocomplete', []).directive('ionAutocomplete', [

// store the start coordinates of the touch start event
var onTouchStart = function (e) {
if (element.attr("disabled")) {
return;
}

scrolling.moved = false;
// Use originalEvent when available, fix compatibility with jQuery
if (typeof(e.originalEvent) !== 'undefined') {
Expand All @@ -336,6 +340,10 @@ angular.module('ion-autocomplete', []).directive('ionAutocomplete', [

// check if the finger moves more than 10px and set the moved flag to true
var onTouchMove = function (e) {
if (element.attr("disabled")) {
return;
}

// Use originalEvent when available, fix compatibility with jQuery
if (typeof(e.originalEvent) !== 'undefined') {
e = e.originalEvent;
Expand All @@ -348,6 +356,10 @@ angular.module('ion-autocomplete', []).directive('ionAutocomplete', [

// click handler on the input field to show the search container
var onClick = function (event) {
if (element.attr("disabled")) {
return;
}

// only open the dialog if was not touched at the beginning of a legitimate scroll event
if (scrolling.moved) {
return;
Expand Down