Commit 07fe0c3
committed
🐛 Fix TypeError for color on nested blocks
Reading a `color` property on a row or column block with a nested text
block lead to a TypeError:
> TypeError: Invalid value for "definition/content/0/rows/0/color":
> Expected valid color, got: {type: 'RGB', red: 0, green: 0.3, blue:
> 0.5}
This happened because the `readColor()` function transforms the input
and did not accept its own result type as input. For nested blocks, the
inherited `color` property is parsed twice if not overwritten.
As a quick fix, this commit changes the `readColor()` function to accept
its own result type, i.e. an object with type `RGB`.
Fixes #951 parent 87ef775 commit 07fe0c3
2 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
0 commit comments