Bug fixes and tidyup
This commit is contained in:
parent
19a379e8d4
commit
2c228fee81
|
@ -11,11 +11,10 @@
|
||||||
let centerPlaceholder = textAlign === "center"
|
let centerPlaceholder = textAlign === "center"
|
||||||
|
|
||||||
let style = buildStyle({ width, textAlign })
|
let style = buildStyle({ width, textAlign })
|
||||||
|
|
||||||
function handleChange(val) {
|
function handleChange(val) {
|
||||||
value = val
|
value = val
|
||||||
let _value = suffix ? value + suffix : value
|
onChange(value)
|
||||||
onChange(_value)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$: displayValue = suffix && value.endsWith(suffix) ? value.replace(new RegExp(`${suffix}$`), "") : value
|
$: displayValue = suffix && value.endsWith(suffix) ? value.replace(new RegExp(`${suffix}$`), "") : value
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
placeholder={m.placeholder || ''}
|
placeholder={m.placeholder || ''}
|
||||||
value={!displayValues || displayValues[i] === '0' ? '' : displayValues[i]}
|
value={!displayValues || displayValues[i] === '0' ? '' : displayValues[i]}
|
||||||
on:change={e => handleChange(e.target.value || 0, i)} />
|
onChange={value => handleChange(value || 0, i)} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -236,27 +236,27 @@ export default {
|
||||||
label: "Heading",
|
label: "Heading",
|
||||||
key: "heading",
|
key: "heading",
|
||||||
control: Input,
|
control: Input,
|
||||||
placeholder: "text",
|
placeholder: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Subheading",
|
label: "Subheading",
|
||||||
key: "subheading",
|
key: "subheading",
|
||||||
control: Input,
|
control: Input,
|
||||||
placeholder: "text",
|
placeholder: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Content",
|
label: "Content",
|
||||||
key: "content",
|
key: "content",
|
||||||
control: Input,
|
control: Input,
|
||||||
placeholder: "text"
|
placeholder: "text",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Image",
|
label: "Image",
|
||||||
key: "imageUrl",
|
key: "imageUrl",
|
||||||
control: Input,
|
control: Input,
|
||||||
placeholder: "src"
|
placeholder: "src",
|
||||||
},
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue