Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/editor/core/src/ui/mentions/MentionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {
const selectItem = (index: number) => {
const item = props.items[index];

console.log(props.command);

if (item) {
props.command({
id: item.id,
Expand Down Expand Up @@ -71,15 +69,15 @@ const MentionList = forwardRef((props: MentionListProps, ref) => {

if (event.key === "Enter") {
enterHandler();
return false;
return true;
}

return false;
},
}));

return props.items && props.items.length !== 0 ? (
<div className="absolute max-h-40 bg-custom-background-100 rounded-md shadow-custom-shadow-sm text-custom-text-300 text-sm overflow-y-auto w-48 p-1 space-y-0.5">
<div className="mentions absolute max-h-40 bg-custom-background-100 rounded-md shadow-custom-shadow-sm text-custom-text-300 text-sm overflow-y-auto w-48 p-1 space-y-0.5">
{props.items.length ? (
props.items.map((item, index) => (
<div
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EnterKeyExtension } from "./enter-key-extension";

export const LiteTextEditorExtensions = (onEnterKeyPress?: () => void) => [
EnterKeyExtension(onEnterKeyPress),
// EnterKeyExtension(onEnterKeyPress),
];
3 changes: 3 additions & 0 deletions packages/editor/lite-text-editor/src/ui/read-only/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface ICoreReadOnlyEditor {
noBorder?: boolean;
borderOnFocus?: boolean;
customClassName?: string;
mentionHighlights: string[]
}

interface EditorCoreProps extends ICoreReadOnlyEditor {
Expand All @@ -26,10 +27,12 @@ const LiteReadOnlyEditor = ({
customClassName,
value,
forwardedRef,
mentionHighlights
}: EditorCoreProps) => {
const editor = useReadOnlyEditor({
value,
forwardedRef,
mentionHighlights
});

const editorClassNames = getEditorClassNames({ noBorder, borderOnFocus, customClassName });
Expand Down
1 change: 1 addition & 0 deletions web/components/issues/comment/comment-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const CommentCard: React.FC<Props> = ({
ref={showEditorRef}
value={comment.comment_html}
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
mentionHighlights={editorSuggestions.mentionHighlights}
/>
<CommentReaction projectId={comment.project} commentId={comment.id} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const IssueCommentCard: React.FC<IIssueCommentCard> = (props) => {
ref={showEditorRef}
value={comment.comment_html}
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
mentionHighlights={editorSuggestions.mentionHighlights}
/>

<div className="mt-1">
Expand Down