MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / shouldToggle

Function shouldToggle

core/src/components/toggle/toggle.tsx:522–528  ·  view source on GitHub ↗
(rtl: boolean, checked: boolean, deltaX: number, margin: number)

Source from the content-addressed store, hash-verified

520}
521
522const shouldToggle = (rtl: boolean, checked: boolean, deltaX: number, margin: number): boolean => {
523 if (checked) {
524 return (!rtl && margin > deltaX) || (rtl && -margin < deltaX);
525 } else {
526 return (!rtl && -margin < deltaX) || (rtl && margin > deltaX);
527 }
528};
529
530let toggleIds = 0;

Callers 1

onMoveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected