mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(button): add button-disabled class when disabled attribute is on button
closes #741
This commit is contained in:
2
ionic/components/app/normalize.scss
vendored
2
ionic/components/app/normalize.scss
vendored
@@ -127,7 +127,7 @@ button {
|
||||
}
|
||||
|
||||
// Re-set default cursor for disabled elements.
|
||||
button[disabled],
|
||||
.button-disabled,
|
||||
html input[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import {Toolbar} from '../toolbar/toolbar';
|
||||
* @property [full] - for a full width button
|
||||
* @property [small] - sets button size to small
|
||||
* @property [large] - sets button size to large
|
||||
* @property [disabled] - disables the button
|
||||
* @property [fab] - for a floating action button
|
||||
* @property [fab-left] - position a fab button to the left
|
||||
* @property [fab-right] - position a fab button to the right
|
||||
@@ -43,6 +44,7 @@ export class Button {
|
||||
this._display = null; // block/full
|
||||
this._colors = []; // primary/secondary
|
||||
this._icon = null; // left/right/only
|
||||
this._disabled = false; // disabled
|
||||
|
||||
let element = elementRef.nativeElement;
|
||||
|
||||
@@ -56,6 +58,10 @@ export class Button {
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.hasAttribute('disabled')) {
|
||||
this._disabled = true;
|
||||
}
|
||||
|
||||
this._readAttrs(element);
|
||||
this._readIcon(element);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user