mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
fix(segment): do not show ripple effect if disabled via config (#20542)
fixes #20533
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop, State, Watch, h, writeTask } from '@stencil/core';
|
import { Component, ComponentInterface, Element, Event, EventEmitter, Host, Prop, State, Watch, h, writeTask } from '@stencil/core';
|
||||||
|
|
||||||
|
import { config } from '../../global/config';
|
||||||
import { getIonMode } from '../../global/ionic-global';
|
import { getIonMode } from '../../global/ionic-global';
|
||||||
import { Color, SegmentChangeEventDetail, StyleEventDetail } from '../../interface';
|
import { Color, SegmentChangeEventDetail, StyleEventDetail } from '../../interface';
|
||||||
import { Gesture, GestureDetail } from '../../utils/gesture';
|
import { Gesture, GestureDetail } from '../../utils/gesture';
|
||||||
@ -145,6 +146,9 @@ export class Segment implements ComponentInterface {
|
|||||||
* and where the cursor ended.
|
* and where the cursor ended.
|
||||||
*/
|
*/
|
||||||
private addRipple(detail: GestureDetail) {
|
private addRipple(detail: GestureDetail) {
|
||||||
|
const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);
|
||||||
|
if (!useRippleEffect) { return; }
|
||||||
|
|
||||||
const buttons = this.getButtons();
|
const buttons = this.getButtons();
|
||||||
const checked = buttons.find(button => button.value === this.value);
|
const checked = buttons.find(button => button.value === this.value);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user