mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Make the hashtag typing experience slightly better
This commit is contained in:
parent
563a1ffd9b
commit
37f7c2a581
1 changed files with 5 additions and 2 deletions
|
@ -186,7 +186,7 @@ function Hashtags(props) {
|
||||||
<form
|
<form
|
||||||
onSubmit={(e) => {
|
onSubmit={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const newHashtag = e.target[0].value;
|
const newHashtag = e.target[0].value?.trim?.();
|
||||||
// Use includes but need to be case insensitive
|
// Use includes but need to be case insensitive
|
||||||
if (
|
if (
|
||||||
newHashtag &&
|
newHashtag &&
|
||||||
|
@ -212,8 +212,11 @@ function Hashtags(props) {
|
||||||
reachLimit ? `Max ${TOTAL_TAGS_LIMIT} tags` : 'Add hashtag'
|
reachLimit ? `Max ${TOTAL_TAGS_LIMIT} tags` : 'Add hashtag'
|
||||||
}
|
}
|
||||||
required
|
required
|
||||||
|
autocorrect="off"
|
||||||
|
autocapitalize="off"
|
||||||
|
spellcheck={false}
|
||||||
// no spaces, no hashtags
|
// no spaces, no hashtags
|
||||||
pattern="[^\s#]+"
|
pattern="[^#][^\s#]+[^#]"
|
||||||
disabled={reachLimit}
|
disabled={reachLimit}
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue