Skip to content

Commit c1eb752

Browse files
committed
fixup! docs(list): improve examples & clarify things a bit more
1 parent 4dc2c79 commit c1eb752

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed

src/components/list/examples/list-primary-component.tsx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,21 @@ import { Component, h } from '@stencil/core';
33

44
/**
55
* List with a primary component
6-
/**
7-
* List with a primary component
8-
*
9-
* List items can render a custom primary component using the
10-
* `primaryComponent` prop.
11-
*
12-
* :::tip
13-
* By default, the primary component is rendered after the icon
14-
* and before the item's text.
15-
*
16-
* Since the list item is a flexbox, you can easily change the
17-
* order of the primary component by applying a different `order`
18-
* via `style`.
19-
*
20-
* You can set `order` either via the primary component's own styles,
21-
* or via its `props`.
22-
* :::
23-
*/
6+
*
7+
* List items can render a custom primary component using the
8+
* `primaryComponent` prop.
9+
*
10+
* :::tip
11+
* By default, the primary component is rendered after the icon
12+
* and before the item's text.
13+
*
14+
* Since the list item is a flexbox, you can easily change the
15+
* order of the primary component by applying a different `order`
16+
* via `style`.
17+
*
18+
* You can set `order` either via the primary component's own styles,
19+
* or via its `props`.
20+
* :::
2421
*/
2522
@Component({
2623
tag: 'limel-example-list-primary-component',

src/components/list/examples/list-selectable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export class SelectableListExample {
6262
}
6363

6464
private handleChange = (event: LimelListCustomEvent<ListItem>) => {
65-
this.lastEvent = `${event.detail.text} (selected: ${
66-
(event.detail as any).selected ? 'true' : 'false'
67-
})`;
65+
const isSelected = event.detail.selected === true;
66+
this.lastEvent = `${event.detail.text} (selected: ${isSelected ? 'true' : 'false'})`;
67+
6868
this.items = this.items.map((item: ListItem) => {
6969
if (item.value === event.detail.value) {
7070
return event.detail;

0 commit comments

Comments
 (0)