Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(segment): do not show ripple effect if disabled via config #20542

Merged
merged 3 commits into from
Feb 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/components/segment/segment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
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 { Color, SegmentChangeEventDetail, StyleEventDetail } from '../../interface';
import { Gesture, GestureDetail } from '../../utils/gesture';
Expand Down Expand Up @@ -145,6 +146,9 @@ export class Segment implements ComponentInterface {
* and where the cursor ended.
*/
private addRipple(detail: GestureDetail) {
const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);
if (!useRippleEffect) { return; }

const buttons = this.getButtons();
const checked = buttons.find(button => button.value === this.value);

Expand Down