Skip to content

Commit

Permalink
Fix #4651: Toggle button hasIcon check (#4652)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Jul 13, 2023
1 parent 1b94a53 commit 798ce3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/lib/togglebutton/ToggleButton.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react';
import { PrimeReactContext } from '../api/Api';
import { useMountEffect } from '../hooks/Hooks';
import { Ripple } from '../ripple/Ripple';
import { Tooltip } from '../tooltip/Tooltip';
import { classNames, DomHandler, IconUtils, mergeProps, ObjectUtils } from '../utils/Utils';
import { ToggleButtonBase } from './ToggleButtonBase';
import { PrimeReactContext } from '../api/Api';

export const ToggleButton = React.memo(
React.forwardRef((inProps, ref) => {
Expand All @@ -16,7 +16,7 @@ export const ToggleButton = React.memo(
props
});
const hasLabel = props.onLabel && props.onLabel.length > 0 && props.offLabel && props.offLabel.length > 0;
const hasIcon = props.onIcon && props.onIcon.length > 0 && props.offIcon && props.offIcon.length > 0;
const hasIcon = props.onIcon && props.offIcon;
const label = hasLabel ? (props.checked ? props.onLabel : props.offLabel) : ' ';
const icon = props.checked ? props.onIcon : props.offIcon;

Expand Down

0 comments on commit 798ce3a

Please sign in to comment.