ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Cannot disable an ion-list button on Ionic 2

Open boaz-chen opened this issue 10 years ago • 5 comments

I have the following view which doesn't work as expected (button isn't disabled):

<ion-list> <button ion-item disabled> My Button </button> </ion-list>

Ionic Version: 2.0.0-beta.3

boaz-chen avatar Apr 10 '16 15:04 boaz-chen

In my opinion: You cannot combine button with ion-item directive?!

johnfakeacc avatar Apr 10 '16 15:04 johnfakeacc

You can: http://ionicframework.com/docs/v2/api/components/item/Item/

"Use

As a workaround for now I've defined the following CSS:

.item-disabled, item-disabled * { opacity: 0.3; pointer-events: none; }

And then in my HTML:

<ion-list> <button ion-item class="item-disabled"> My Button </button> </ion-list>

boaz-chen avatar Apr 11 '16 07:04 boaz-chen

This has been added to the beta.8 release. If you'd like to check it out sooner, I've released a nightly version that can be installed by running the following in a terminal:

npm install --save [email protected]

If you haven't updated to beta.7 yet, check out the changelog for steps to update.

Let me know if you find any issues. Thanks!

brandyscarney avatar May 20 '16 21:05 brandyscarney

Thanks so much!

boaz-chen avatar Jun 07 '16 04:06 boaz-chen