Skip to content

Commit 3a62b6e

Browse files
committed
[#131] feat: shift enter interaction 구현
1 parent 7aaaafe commit 3a62b6e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/src/components/atoms/BlockContent/BlockContent.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ function BlockContent(blockDTO: Block) {
170170
Dispatcher((event.shiftKey ? 'shift' : '') + event.key);
171171
throttleState.isThrottle = false;
172172
});
173+
} else if (event.key === 'Enter' && event.shiftKey) {
174+
const { textContent } = contentEditableRef.current;
175+
const caretOffset = window.getSelection().focusOffset;
176+
const cvTextContent = textContent
177+
.slice(0, caretOffset)
178+
.concat('\n', textContent.slice(caretOffset));
179+
handleBlock(cvTextContent, null, caretOffset + 1);
173180
}
174181
};
175182

0 commit comments

Comments
 (0)