Skip to content

Commit 78573e4

Browse files
committed
fix: enter
1 parent d95e5a0 commit 78573e4

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/components/mention-input.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,18 @@ export default function MentionInput({
160160
?.flatMap(({ content }) => {
161161
return content
162162
?.filter((v) => v.type == "mention")
163-
.map((v) => v.attrs);
163+
.map(
164+
(v) =>
165+
(
166+
v as {
167+
type: "mention";
168+
attrs: {
169+
id: string;
170+
label: string;
171+
};
172+
}
173+
).attrs,
174+
);
164175
})
165176
.filter(Boolean) as { label: string; id: string }[];
166177
latestContent.current = {
@@ -169,7 +180,7 @@ export default function MentionInput({
169180
};
170181
onChange?.({
171182
json,
172-
text,
183+
text: text.trim(),
173184
mentions,
174185
});
175186
},

0 commit comments

Comments
 (0)