mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 07:00:58 -05:00
fix: category title input reverts to span on empty string (#699)
Fixes https://github.com/revoltchat/revite/issues/693
This commit is contained in:
parent
e34c5c99fe
commit
2f43a2c32d
1 changed files with 5 additions and 3 deletions
|
@ -340,11 +340,13 @@ function ListElement({
|
|||
|
||||
const save = useCallback(() => {
|
||||
setEditing(undefined);
|
||||
setTitle!(editing!);
|
||||
if (editing !== "") {
|
||||
setTitle!(editing!);
|
||||
}
|
||||
}, [editing, setTitle]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!editing) return;
|
||||
if (editing === undefined) return;
|
||||
|
||||
function onClick(ev: MouseEvent) {
|
||||
if ((ev.target as HTMLElement)?.id !== category.id) {
|
||||
|
@ -368,7 +370,7 @@ function ListElement({
|
|||
<div className="inner">
|
||||
<Row>
|
||||
<KanbanListHeader {...provided.dragHandleProps}>
|
||||
{editing ? (
|
||||
{editing !== undefined ? (
|
||||
<input
|
||||
value={editing}
|
||||
onChange={(e) =>
|
||||
|
|
Loading…
Reference in a new issue