mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
improved form usability
This commit is contained in:
1 parent
d2daeb80a1
commit
effc31c19d
1 file changed
+11
-4
@@ -15,10 +15,17 @@ export const TodoList = (props) => {
|
||||
<label>Sharing url: </label>
|
||||
<input type="text" readonly value={window.location.href} />
|
||||
<div className={'field-row'}>
|
||||
<input id="newtask" type="text" onChange={(e) => setNewTaskText(e.target.value)} />
|
||||
<label htmlFor="newtask">
|
||||
<button onClick={() => addTask(newTaskText, list.id)}>add task</button>
|
||||
</label>
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault()
|
||||
setNewTaskText('')
|
||||
}}
|
||||
>
|
||||
<input id="newtask" type="text" value={newTaskText} onChange={(e) => setNewTaskText(e.target.value)} />
|
||||
<button type="submit" onClick={() => addTask(newTaskText, list.id)}>
|
||||
add task
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{tasks
|
||||
? tasks.map((task) => {
|
||||
|
||||
Reference in new issue
Block a user