patternfly-react icon indicating copy to clipboard operation
patternfly-react copied to clipboard

fix(MenuToggle): fix indeterminate checkbox error, toggle click behavior

Open kmcfaul opened this issue 1 year ago • 2 comments
trafficstars

What: Closes #10034 and #10035

For 10034 - checked needed to use the result of calculateChecked instead of just the isChecked prop (because null needs to be re-resolved to false to prevent the issue).

For 10035 - This one is a little tricky, because the new toggle structure was not set up to wrap or pass the toggle click handler to the splitButtonItems. I've opted to put the onClick on the outer div wrapper, and prevent propagation in the splitButtonItems (on the action button and checkbox input specifically), but we may want to consider which behavior we want. We can use the changes in the PR currently (the whole div becomes clickable), or make the checkbox label text click trigger the checkbox input change handler instead (keeping the toggle button as the only toggle click handler), or let a user pass the onClick manually to the MenuToggleCheckbox.

kmcfaul avatar Feb 06 '24 18:02 kmcfaul

Preview: https://patternfly-react-pr-10066.surge.sh

A11y report: https://patternfly-react-pr-10066-a11y.surge.sh

patternfly-build avatar Feb 06 '24 18:02 patternfly-build

@mattnolting

kmcfaul avatar Feb 28 '24 16:02 kmcfaul

Per working session conversation, I'm adjusting the click changes to not use a click event on the outer div (which doesn't really make sense and would cause some accessibility issues). Now, clicking the text should check/uncheck the checkbox, as is the usual behavior for checkboxes with labels. Toggling can only be done with the toggle button for splitButtonAction toggles because the behavior is divided between two interactive elements.

kmcfaul avatar Mar 25 '24 15:03 kmcfaul

Your changes have been released in:

Thanks for your contribution! :tada:

patternfly-build avatar Mar 26 '24 18:03 patternfly-build