The root cause is that showMoreLess is dynamically computed based on the code snippet height (the button is shown if a multi-line code snippet exceeds 255px). Additionally, the showMoreLess prop is initialized as false when it should be the opposite (allowing the consumer to set it to false).
This PR fixes the logic:
flip the default boolean value
only compute the show logic if showMoreLess is not false
Additionally, it adds the following examples to the docs:
Fixes https://github.com/carbon-design-system/carbon-components-svelte/issues/1536
Currently, the following does not work as intended:
The root cause is that
showMoreLess
is dynamically computed based on the code snippet height (the button is shown if a multi-line code snippet exceeds 255px). Additionally, theshowMoreLess
prop is initialized asfalse
when it should be the opposite (allowing the consumer to set it tofalse
).This PR fixes the logic:
boolean
valueshowMoreLess
is notfalse
Additionally, it adds the following examples to the docs: