Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

버그 수정 및 서버 동기화 로직 적용 #135

Merged
merged 12 commits into from
Dec 18, 2020
Merged

Conversation

domino8788
Copy link
Collaborator

버그 수정 및 서버 동기화 로직 적용

해당 이슈 📎

#134 #118

변경 사항 🛠

구현내용 요약

  • 버그 수정
  • 서버 동기화 로직 적용

테스트 ✨

없음

리뷰어 참고 사항 🙋‍♀️

@@ -287,6 +295,7 @@ function BlockContent(blockDTO: Block) {
contentEditable
onKeyDown={handleKeyDown}
suppressContentEditableWarning
spellCheck={false}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음 알게 된 애트리뷰트네요...

Copy link
Collaborator

@skid901 skid901 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으셨습니다 ^^7

Copy link
Collaborator

@YiSoJeong YiSoJeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 😇

);
setImmediate(() => {
setCaretOffset(caretOffset === -1 ? focusOffset : caretOffset);
setFocus(blockDTO);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 그놈의 Focus..ㅠ

Comment on lines +42 to +51
const getTopAncestor = () => {
const root = blockMap[page.rootId];
const rootChildren = root.childIdList;
let currentParent = block;
while (!rootChildren.includes(currentParent.id)) {
currentParent = blockMap[currentParent.parentId];
}
return currentParent;
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

새로운 패밀리의 등장이군용 ㅎ

Comment on lines +198 to +200
(event.key === 'Backspace' &&
!focusOffset &&
focusOffset === anchorOffset)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이제 드래그 상태도 적용되네요..!

startTransaction();
const newBlock = insertNewSibling(updatedBlock);
const newBlock = await insertNewSibling({ type }, blockIndex + 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blockIndex + 1 이 디폴트 값 아닌가용?🤔

Comment on lines 169 to 190
const setCaretOffset = (
offset: number = window.getSelection().focusOffset,
isBlur: boolean = true,
isCaret: boolean = true,
) => {
const sel = window.getSelection();
const { focusNode: node } = sel;
const { length } = node as any;
!(node instanceof HTMLElement) &&
sel.collapse(node, offset > length ? length : offset);
const { focusNode: beforeNode } = sel;
if (isBlur) {
beforeNode.parentElement.blur();
}
setTimeout(() => {
const { focusNode: afterNode } = window.getSelection();
const length = (afterNode as any).length && afterNode.textContent.length;
if (length && isCaret)
sel.collapse(beforeNode, offset > length ? length : offset);
});
// else {
// const { focusNode: afterNode } = window.getSelection();
// const length = (afterNode as any).length && afterNode.textContent.length;
// if (length) sel.collapse(beforeNode, offset > length ? length : offset);
// }
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

캐럿 로직 복잡하네용..ㅠ

@domino8788 domino8788 merged commit 86d876d into dev-frontend Dec 18, 2020
@domino8788 domino8788 deleted the fix/134 branch December 18, 2020 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🐣 feature New feature or request 🌈 frontend Frontend issue 🔧 refactor 💯 must
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants