-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Native input elements do not have this issue.
import { For } from "solid-js";
import { createStore } from "solid-js/store";
import { TextField } from "@suid/material";
function App() {
const [textFieldInputs, setTextFieldInputs] = createStore<string[]>([""]);
const [nativeInputs, setNativeInputs] = createStore<string[]>([""]);
const updateTextFieldInput = (index: number, value: string) => {
setTextFieldInputs(index, value);
};
const updateNativeInput = (index: number, value: string) => {
setNativeInputs(index, value);
};
return (
<div>
<h4>TextField</h4>
<For each={textFieldInputs}>
{(input, index) => (
<TextField
value={input}
onChange={(e) => updateTextFieldInput(index(), e.target.value)}
size="small"
/>
)}
</For>
<h4>Native Input</h4>
<For each={nativeInputs}>
{(input, index) => (
<input
value={input}
onChange={(e) => updateNativeInput(index(), e.target.value)}
size="small"
/>
)}
</For>
</div>
);
}
export default App;Metadata
Metadata
Assignees
Labels
No labels