fix(ui): bind textarea values without markup
This commit is contained in:
@@ -617,7 +617,7 @@
|
|||||||
},
|
},
|
||||||
"packages/ui": {
|
"packages/ui": {
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.8.17",
|
"version": "0.8.18",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@wrnexus/core": "workspace:*",
|
"@wrnexus/core": "workspace:*",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ size: string = "default"
|
|||||||
<div class="wrn-next__field-heading"><label class="{hiddenLabel ? 'wrn-next__sr-only' : ''}" for="{id || name}">{label}</label>{#if cornerHint}<span class="wrn-next__field-hint">{cornerHint}</span>{/if}</div>
|
<div class="wrn-next__field-heading"><label class="{hiddenLabel ? 'wrn-next__sr-only' : ''}" for="{id || name}">{label}</label>{#if cornerHint}<span class="wrn-next__field-hint">{cornerHint}</span>{/if}</div>
|
||||||
<div class="wrn-next__field-control" data-icon-position="{iconPosition}">
|
<div class="wrn-next__field-control" data-icon-position="{iconPosition}">
|
||||||
{#if icon}<span class="{icon} wrn-next__field-icon" aria-hidden="true"></span>{/if}
|
{#if icon}<span class="{icon} wrn-next__field-icon" aria-hidden="true"></span>{/if}
|
||||||
<textarea id="{id || name}" name="{name}" placeholder="{variant === 'floating' ? ' ' : placeholder}" rows="{rows}" style="resize: {resize}" readonly="{readonly}" disabled="{disabled}" required="{required}" minlength="{minlength}" maxlength="{maxlength}" aria-invalid="{error ? 'true' : 'false'}" aria-describedby="{error ? (id || name) + '-error' : (helperText ? (id || name) + '-help' : '')}" @input="emitField('input', event)" @change="emitField('change', event)" @focus="emitField('focus', event)" @blur="emitField('blur', event)" @invalid="handleInvalid(event)">{value}</textarea>
|
<textarea id="{id || name}" name="{name}" value="{value}" placeholder="{variant === 'floating' ? ' ' : placeholder}" rows="{rows}" style="resize: {resize}" readonly="{readonly}" disabled="{disabled}" required="{required}" minlength="{minlength}" maxlength="{maxlength}" aria-invalid="{error ? 'true' : 'false'}" aria-describedby="{error ? (id || name) + '-error' : (helperText ? (id || name) + '-help' : '')}" @input="emitField('input', event)" @change="emitField('change', event)" @focus="emitField('focus', event)" @blur="emitField('blur', event)" @invalid="handleInvalid(event)"></textarea>
|
||||||
{#if variant === "floating"}<span class="wrn-next__field-floating-label">{label}</span>{/if}
|
{#if variant === "floating"}<span class="wrn-next__field-floating-label">{label}</span>{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if helperText}<small id="{(id || name) + '-help'}" class="wrn-next__field-help">{helperText}</small>{/if}
|
{#if helperText}<small id="{(id || name) + '-help'}" class="wrn-next__field-help">{helperText}</small>{/if}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@wrnexus/ui",
|
"name": "@wrnexus/ui",
|
||||||
"version": "0.8.17",
|
"version": "0.8.18",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ test("bundled UI assets are discoverable and readable", () => {
|
|||||||
expect(uiCss()).toContain("--wrn-");
|
expect(uiCss()).toContain("--wrn-");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Textarea binds its value without rendering hydration markup as user content", () => {
|
||||||
|
const source = readFileSync(uiComponentPath("Textarea"), "utf8");
|
||||||
|
expect(source).toContain('value="{value}"');
|
||||||
|
expect(source).not.toContain(">{value}</textarea>");
|
||||||
|
});
|
||||||
|
|
||||||
test("global UI CSS stays below its migration ratchet", () => {
|
test("global UI CSS stays below its migration ratchet", () => {
|
||||||
const css = uiCss();
|
const css = uiCss();
|
||||||
// Component selectors belong to their owning .wrn files. Keep this asset to
|
// Component selectors belong to their owning .wrn files. Keep this asset to
|
||||||
|
|||||||
Reference in New Issue
Block a user