ionic-team / ionic-v1

The repo for Ionic 1.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
193 stars 187 forks source link

bug: data-tap-disabled doesn't disable button #166

Open jgw96 opened 7 years ago

jgw96 commented 7 years ago

From @dwilt on March 9, 2016 19:42

Short description of the problem:

I've got a button that I'm trying to disable the on-tap via data-tap-disabled when a certain function returns true. However, the button is still enabled when the function returns true.

There is also an ng-class applying a disabled class using the same function and it is working. Also, if I change the data-tap-disabled to ng-disabled, the button becomes disabled (it can't be clicked and the disabled="disabled attribute is applied). So I know it's the data-tap-disabled directive which doesn't seem to be working correctly.

What behavior are you expecting?

I'm expecting the button to be disabled with a disabled="disabled attribute on the button - similar to how ng-disabled works for ng-click.

button.clear-button.white(
    on-tap="checklist.publish()"
    data-tap-disabled="!checklist.readyToPublish()"
    ng-class="{'disabled': !checklist.readyToPublish()}"
    translate="tour-publish-checklist.list.publish"
)

Ionic Version: v1.2.4-nightly-1917 Browser & Operating System: iOS / Chrome

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.1
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X Yosemite
Node Version: v5.7.1
Xcode version: Xcode 7.2.1 Build version 7C1002 

Copied from original issue: driftyco/ionic#5786