mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
feat(ripple): adds unbounded ripple-effect (#16399)
This commit is contained in:
@ -13,6 +13,9 @@ import { createColorClasses, openURL } from '../../utils/theme';
|
||||
shadow: true,
|
||||
})
|
||||
export class Button implements ComponentInterface {
|
||||
|
||||
private inToolbar = false;
|
||||
|
||||
@Element() el!: HTMLElement;
|
||||
|
||||
@Prop({ context: 'window' }) win!: Window;
|
||||
@ -97,9 +100,7 @@ export class Button implements ComponentInterface {
|
||||
@Event() ionBlur!: EventEmitter<void>;
|
||||
|
||||
componentWillLoad() {
|
||||
if (this.fill === undefined) {
|
||||
this.fill = this.el.closest('ion-buttons') ? 'clear' : 'solid';
|
||||
}
|
||||
this.inToolbar = !!this.el.closest('ion-buttons');
|
||||
}
|
||||
|
||||
private onFocus = () => {
|
||||
@ -139,8 +140,11 @@ export class Button implements ComponentInterface {
|
||||
}
|
||||
|
||||
hostData() {
|
||||
const { buttonType, keyFocus, disabled, color, expand, fill, shape, size, strong } = this;
|
||||
|
||||
const { buttonType, keyFocus, disabled, color, expand, shape, size, strong } = this;
|
||||
let fill = this.fill;
|
||||
if (fill === undefined) {
|
||||
fill = this.inToolbar ? 'clear' : 'solid';
|
||||
}
|
||||
return {
|
||||
'ion-activatable': true,
|
||||
'aria-disabled': this.disabled ? 'true' : null,
|
||||
@ -181,7 +185,7 @@ export class Button implements ComponentInterface {
|
||||
<slot></slot>
|
||||
<slot name="end"></slot>
|
||||
</span>
|
||||
{this.mode === 'md' && <ion-ripple-effect></ion-ripple-effect>}
|
||||
{this.mode === 'md' && <ion-ripple-effect type={this.inToolbar ? 'unbounded' : 'bounded'}></ion-ripple-effect>}
|
||||
</TagType>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user