patternfly / patternfly-quickstarts

Repository containing the PatternFly Quick Start extension code
MIT License
15 stars 38 forks source link

[HelpTopics] Extra "0" character after the help content #177

Closed Hyperkid123 closed 2 years ago

Hyperkid123 commented 2 years ago

There is an extra "0" character after the content.

screenshot-stage foo redhat com_1337-2022 06 08-09_55_35

CooperRedhat commented 2 years ago

Can you point me to the source yaml for this?

jschuler commented 2 years ago

I believe the bug results here https://github.com/patternfly/patternfly-quickstarts/blob/b5a0af15e6a167b32182e16ce216b923d2b32692/packages/module/src/HelpTopicPanelContent.tsx#L69 {activeHelpTopic?.links?.length && <Divider />}

and happens if activeHelpTopic?.links?.length is 0

react attempts to render the left value if it is falsy (which 0 is), and since 0 is a number, react will render it. If the left value was false it would not render it. Possible fix (untested) is by using the doublebang to make the left value false {!!activeHelpTopic?.links?.length && <Divider />}