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(() => {
|
const save = useCallback(() => {
|
||||||
setEditing(undefined);
|
setEditing(undefined);
|
||||||
setTitle!(editing!);
|
if (editing !== "") {
|
||||||
|
setTitle!(editing!);
|
||||||
|
}
|
||||||
}, [editing, setTitle]);
|
}, [editing, setTitle]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editing) return;
|
if (editing === undefined) return;
|
||||||
|
|
||||||
function onClick(ev: MouseEvent) {
|
function onClick(ev: MouseEvent) {
|
||||||
if ((ev.target as HTMLElement)?.id !== category.id) {
|
if ((ev.target as HTMLElement)?.id !== category.id) {
|
||||||
|
@ -368,7 +370,7 @@ function ListElement({
|
||||||
<div className="inner">
|
<div className="inner">
|
||||||
<Row>
|
<Row>
|
||||||
<KanbanListHeader {...provided.dragHandleProps}>
|
<KanbanListHeader {...provided.dragHandleProps}>
|
||||||
{editing ? (
|
{editing !== undefined ? (
|
||||||
<input
|
<input
|
||||||
value={editing}
|
value={editing}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
|
|
Loading…
Reference in a new issue