docs(code-snippet): update hidden example copy

This commit is contained in:
Eric Liu 2020-10-30 10:48:12 -07:00
commit 882737c8b8
2 changed files with 4 additions and 2 deletions

View file

@ -59,7 +59,7 @@ For dynamically updated code, you must use the `code` prop instead of the defaul
### Hidden multi-line code ### Hidden multi-line code
There may be cases where your code snippet is visually hidden. The logic to render the "Show more" button relies on the element's computed height. For visually hidden content, the button will not appear because the height is `0`. There may be cases where your code snippet is hidden in the DOM. The logic to render the "Show more" button relies on the element's computed height. For hidden content, the button will not appear because the computed height is `0`.
The recommended workaround is to re-render the component. See the example below. The recommended workaround is to re-render the component. See the example below.

View file

@ -28,5 +28,7 @@
{#if toggled} {#if toggled}
<br /><br /> <br /><br />
<h5>"Show more" will render</h5><br /> <h5>"Show more" will render</h5><br />
<div class:hidden="{!toggled}">
<CodeSnippet type="multi" code="{code}" /> <CodeSnippet type="multi" code="{code}" />
</div>
{/if} {/if}