Basic validation

This commit is contained in:
Lim Chee Aun 2023-02-16 18:22:19 +08:00
parent bec531df05
commit 73e8bed5f0

View file

@ -317,7 +317,7 @@ function ShortcutForm({ type, lists, followedHashtags, onSubmit }) {
<p> <p>
<label> <label>
<span>List</span> <span>List</span>
<select name="id"> <select name="id" required>
{lists.map((list) => ( {lists.map((list) => (
<option value={list.id}>{list.title}</option> <option value={list.id}>{list.title}</option>
))} ))}
@ -331,7 +331,12 @@ function ShortcutForm({ type, lists, followedHashtags, onSubmit }) {
<p> <p>
<label> <label>
<span>{text}</span>{' '} <span>{text}</span>{' '}
<input type={type} name={name} placeholder={placeholder} /> <input
type={type}
name={name}
placeholder={placeholder}
required={type === 'text'}
/>
{currentType === 'hashtag' && followedHashtags.length > 0 && ( {currentType === 'hashtag' && followedHashtags.length > 0 && (
<datalist> <datalist>
{followedHashtags.map((tag) => ( {followedHashtags.map((tag) => (