Why does FieldInput allow a Slot? - causing SSR issue #3158
Replies: 2 comments 2 replies
-
It seems that a similar issue exists with the Allowing a slot inside a You can see in the compiled code below that the slot is passed as a string: return (_ctx, _cache) => {
return openBlock(), createElementBlock("textarea", mergeProps({ ref: unref(autoresizeTextarea) }, unref(field).getTextareaProps(), {
value: _ctx.modelValue,
onInput: _cache[0] || (_cache[0] = (event) => emit("update:modelValue", event.target.value)),
style: props.autoresize ? { resize: "none", overflow: "hidden" } : void 0
}), " <slot />\n ", 16, _hoisted_1);
}; |
Beta Was this translation helpful? Give feedback.
-
It allows a slot because of composition via the <Field.Input asChild>
<input />
</Field.Input> Perhaps we should focus on resolving the SSR issue instead. |
Beta Was this translation helpful? Give feedback.
-
Description
Hey there! 👋🏻
The
FieldInput
component currently allows a slot, which is problematic because the<input>
element is a void element, meaning it cannot have child elements or content according to the HTML specification (MDN).Allowing a slot in the
FieldInput
component creates issues, especially during SSR (Server-Side Rendering), as the slot content is removed on the client side, leading to mismatches between the server-rendered HTML and the client-rendered HTML.I am happy to submit a pull request if you allow me to remove the slot.
Link to Reproduction (or Detailed Explanation)
N/A
Steps to Reproduce
N/A
Ark UI Version
4.5
Framework
Browser
No response
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions