Skip to content

Commit

Permalink
Add button to change own height of StoryHeightRepro
Browse files Browse the repository at this point in the history
  • Loading branch information
jrencz committed Feb 22, 2023
1 parent f52cf25 commit da1369a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ attempts to fix.
```

- Observe problem is gone: all lines are shown
- You may play with both Zoom in/Zoom out controls of Story,
and with component's own button to change size to confirm
24 changes: 23 additions & 1 deletion src/StoryHeightRepro.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { html, css, LitElement } from 'lit';
import {html, LitElement, nothing} from 'lit';
import {state} from 'lit/decorators.js';

export class StoryHeightRepro extends LitElement {
@state()
count = 1;

render() {
return html`
<button @click="${() => {
this.count = 1 + (this.count % 2);
}}">
alter number of elements
</button>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec risus
purus, bibendum nec iaculis non, hendrerit sit amet nibh. Curabitur
finibus vitae nisi at fermentum. Donec vehicula dui eu eros ornare
Expand All @@ -14,6 +23,19 @@ export class StoryHeightRepro extends LitElement {
faucibus pulvinar et sed nunc. Aenean non justo eleifend, condimentum
nibh ut, bibendum odio. Sed feugiat enim vitae neque venenatis, sed
commodo enim ullamcorper.</p>
${this.count > 1
? html`<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec
risus purus, bibendum nec iaculis non, hendrerit sit amet nibh.
Curabitur finibus vitae nisi at fermentum. Donec vehicula dui eu eros
ornare dictum. Etiam gravida et mauris ac tempor. Phasellus finibus
mollis libero. Fusce molestie nisl quis leo porta, a scelerisque dui
iaculis. Duis dictum odio a magna commodo accumsan. In hac habitasse
platea dictumst. Proin volutpat nec ipsum sit amet blandit. Sed purus
tellus, viverra sed sollicitudin ut, pretium non mauris. Aenean et
nunc id augue faucibus pulvinar et sed nunc. Aenean non justo
eleifend, condimentum nibh ut, bibendum odio. Sed feugiat enim vitae
neque venenatis, sed commodo enim ullamcorper.</p>`
: nothing}
`;
}
}

0 comments on commit da1369a

Please sign in to comment.