deactivate when cleaning input field

This commit is contained in:
Alejandro Gomez 2023-01-14 12:37:43 +01:00
parent 4f5d07ecd9
commit 846909536d
No known key found for this signature in database
GPG Key ID: 4DF39E566658C817
2 changed files with 11 additions and 6 deletions

View File

@ -47,6 +47,16 @@ export function NoteCreator(props) {
} }
} }
function onChange(ev) {
const { value } = ev.target
if (value) {
setNote(value)
setActive(true)
} else {
setActive(false)
}
}
if (!show) return false; if (!show) return false;
return ( return (
<> <>
@ -56,7 +66,7 @@ export function NoteCreator(props) {
<Textarea <Textarea
className={`textarea ${active ? "textarea--focused" : ""}`} className={`textarea ${active ? "textarea--focused" : ""}`}
users={users} users={users}
onChange={(ev) => setNote(ev.target.value)} onChange={onChange}
onFocus={() => setActive(true)} onFocus={() => setActive(true)}
/> />
<div className="actions flex f-row"> <div className="actions flex f-row">

View File

@ -1,10 +1,5 @@
.rta {
overflow: visible;
}
.rta__entity { .rta__entity {
background: var(--gray); background: var(--gray);
padding: 4px 8px;
} }
.rta__entity--selected { .rta__entity--selected {