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

MultiSelect Checbox Fix #6162

Merged
merged 9 commits into from
Mar 15, 2024
4 changes: 0 additions & 4 deletions components/lib/multiselect/MultiSelectBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ const classes = {
}),
checkboxContainer: 'p-checkbox p-component',
checkboxIcon: 'p-checkbox-icon p-c',
checkbox: ({ itemProps: props }) =>
classNames('p-checkbox-box', {
'p-highlight': props.selected
}),
transition: 'p-connected-overlay'
};

Expand Down
13 changes: 3 additions & 10 deletions components/lib/multiselect/MultiSelectItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import * as React from 'react';
import { useMergeProps } from '../hooks/Hooks';
import { CheckIcon } from '../icons/check';
import { Ripple } from '../ripple/Ripple';
import { Checkbox } from '../checkbox/Checkbox';
import { IconUtils, ObjectUtils, classNames } from '../utils/Utils';

export const MultiSelectItem = React.memo((props) => {
const [focusedState, setFocusedState] = React.useState(false);
const mergeProps = useMergeProps();
const { ptm, cx } = props;
const { ptm, cx, isUnstyled } = props;

const getPTOptions = (key) => {
return ptm(key, {
Expand Down Expand Up @@ -59,14 +60,6 @@ export const MultiSelectItem = React.memo((props) => {
getPTOptions('checkboxContainer')
);

const checkboxProps = mergeProps(
{
className: cx('checkbox', { itemProps: props }),
'data-p-highlight': props.selected
},
getPTOptions('checkbox')
);

const itemProps = mergeProps(
{
className: classNames(props.className, props.option.className, cx('item', { itemProps: props })),
Expand All @@ -86,7 +79,7 @@ export const MultiSelectItem = React.memo((props) => {
return (
<li {...itemProps}>
<div {...checkboxContainerProps}>
<div {...checkboxProps}>{checkboxIcon}</div>
<Checkbox checked={props.selected} icon={checkboxIcon} pt={ptm('checkbox')} unstyled={isUnstyled()} />
</div>
<span>{content}</span>
<Ripple />
Expand Down
2 changes: 2 additions & 0 deletions components/lib/multiselect/MultiSelectPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const MultiSelectPanel = React.memo(
disabled={disabled}
className={props.itemClassName}
checkboxIcon={props.checkboxIcon}
isUnstyled={isUnstyled}
ptm={ptm}
cx={cx}
/>
Expand Down Expand Up @@ -197,6 +198,7 @@ export const MultiSelectPanel = React.memo(
disabled={disabled}
className={props.itemClassName}
checkboxIcon={props.checkboxIcon}
isUnstyled={isUnstyled}
ptm={ptm}
cx={cx}
/>
Expand Down
Loading