Skip to content

Commit 9b4d5a0

Browse files
committed
feat(text-editor tables): fix example component
1 parent 7f8a6ae commit 9b4d5a0

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

src/components/text-editor/examples/text-editor-with-tables.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,53 @@ import { Component, h, State } from '@stencil/core';
22
/**
33
* Text editor with tables (HTML mode only).
44
*
5-
* When using the text editor in HTML mode, it is possible to paste and
6-
* display tables in the text editor.
7-
* Basic interaction with the table is supported, but you cannot do
8-
* complex operations
5+
* Basic table support is available when using the text editor in `HTML` mode.
6+
* This allows you to paste and display tables in the text editor.
7+
* Complex operations are not supported, adding and removing columns are not supported.
8+
*
9+
* Tables will only appear as expected in text-editor fields that are in `HTML` mode.
910
*/
1011
@Component({
1112
tag: 'limel-example-text-editor-with-tables',
1213
shadow: true,
1314
})
1415
export class TextEditorWithTablesExample {
1516
@State()
16-
private value: string =
17-
'<table><tbody><tr><td style="background-color: rgb(25, 107, 36);color: white;"><p><strong>Column1</strong></p></td><td style="background-color: rgb(25, 107, 36);color: white;"><p><strong>Column2</strong></p></td></tr><tr><td style="background-color: rgb(193, 240, 200);color: black;"><p>Cell A1</p></td><td style="background-color: rgb(193, 240, 200);color: black;"><p>Cell B1</p></td></tr><tr><td style="color: green;"><p>Cell A2</p></td><td style="background-color: yellow;color: red;"><p>Cell B2</p></td></tr></tbody></table>';
17+
private value: string = `<table><tbody>
18+
<tr>
19+
<td style="background-color: rgb(25, 107, 36);color: white;"><p><strong>Column1</strong></p></td>
20+
<td style="background-color: rgb(25, 107, 36);color: white;"><p><strong>Column2</strong></p></td>
21+
</tr>
22+
<tr>
23+
<td style="background-color: rgb(193, 240, 200);color: black;"><p>Cell A1</p></td>
24+
<td style="background-color: rgb(193, 240, 200);color: black;"><p>Cell B1</p></td>
25+
</tr>
26+
<tr>
27+
<td style="background-color: yellow;color: red;"><p>Cell A2</p></td>
28+
<td style="background-color: yellow;color: red;"><p>Cell B2</p></td>
29+
</tr>
30+
</tbody></table>`;
1831

1932
@State()
2033
private readonly = false;
2134

2235
public render() {
2336
return [
2437
<limel-text-editor
38+
key="html-editor"
2539
value={this.value}
2640
onChange={this.handleChange}
2741
readonly={this.readonly}
2842
contentType="html"
29-
enableTables={true}
3043
/>,
31-
<limel-example-controls>
44+
<limel-example-controls key="controls">
3245
<limel-checkbox
3346
checked={this.readonly}
3447
label="Readonly"
3548
onChange={this.setReadonly}
3649
/>
3750
</limel-example-controls>,
38-
<limel-example-value value={this.value} />,
51+
<limel-example-value key="example-value" value={this.value} />,
3952
];
4053
}
4154

0 commit comments

Comments
 (0)