feat(toggle): add toggleOnOffLabels global config option (#26087)

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
This commit is contained in:
Hans
2022-10-31 15:49:15 +01:00
committed by GitHub
parent b364d58710
commit 43e2b3975d
3 changed files with 50 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import type { ComponentInterface, EventEmitter } from '@stencil/core';
import { Component, Element, Event, Host, Prop, State, Watch, h } from '@stencil/core';
import { checkmarkOutline, removeOutline, ellipseOutline } from 'ionicons/icons';
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
import type { Color, Gesture, GestureDetail, Mode, StyleEventDetail, ToggleChangeEventDetail } from '../../interface';
import { getAriaLabel, renderHiddenInput } from '../../utils/helpers';
@ -67,7 +68,7 @@ export class Toggle implements ComponentInterface {
/**
* Enables the on/off accessibility switch labels within the toggle.
*/
@Prop() enableOnOffLabels: boolean | undefined = undefined;
@Prop() enableOnOffLabels: boolean | undefined = config.get('toggleOnOffLabels');
/**
* Emitted when the value property has changed.