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

MenuToggle split button doc updates

Open thatblindgeye opened this issue 1 year ago • 2 comments

Describe the enhancement or change Follow up to https://github.com/patternfly/patternfly-react/pull/10256#pullrequestreview-1987315802

We should update the "Split button toggle with checkbox label" example description to convey something more along the lines that in order to have a label for the checkbox of a split button toggle, consumers should pass children to MenuToggleCheckbox, and that clicking this text will trigger the checkbox's onChange callback.

Additionally we should update the children prop description to indicate how children is rendered for a split toggle.

cc @edonehoo if you wouldn't mind taking a look at the example titles/descriptions touched in the above linked PR

Is this request originating from a Red Hat product team? If so, which ones and is there any sort of deadline for this enhancement?

Any other information?

thatblindgeye avatar Apr 08 '24 20:04 thatblindgeye

@thatblindgeye to make sure I'm understanding, is this correct?

  • the "split button toggle with checkbox label" example allows users to click anywhere in the toggle to select the checkbox?
  • Then the "split button toggle with checkbox and toggle button text" example requires the checkbox specifically to be clicked?
  • The implementation difference is whether or not the label is placed within the MenuToggleCheckbox?

For some reason it almost feels like the descriptions are opposite of the examples in that pr preview, so I just want to make sure I'm following 100% 😁

edonehoo avatar Apr 09 '24 20:04 edonehoo

@edonehoo Basically yeah. For both of those examples, there's the "checkbox area' and the "toggle button" area. So for the "with checkbox label" example, clicking the checkbox or the visible text should trigger the checkbox while clicking the caret icon will trigger the toggle button. For the "with checkbox and toggle button text" example it's the opposite where like you said only clicking the checkbox itself triggers it while clicking the text will trigger the toggle button.

thatblindgeye avatar Apr 10 '24 12:04 thatblindgeye