-
Notifications
You must be signed in to change notification settings - Fork 9
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
버그 수정 및 서버 동기화 로직 적용 #135
Conversation
- blockDTO.value로 변경
- 처음 drag 시 blockHandler가 사라지는 현상 수정 - 서버 동기화 적용
@@ -287,6 +295,7 @@ function BlockContent(blockDTO: Block) { | |||
contentEditable | |||
onKeyDown={handleKeyDown} | |||
suppressContentEditableWarning | |||
spellCheck={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음 알게 된 애트리뷰트네요...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨습니다 ^^7
There was a problem hiding this 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정말 그놈의 Focus..ㅠ
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; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
새로운 패밀리의 등장이군용 ㅎ
(event.key === 'Backspace' && | ||
!focusOffset && | ||
focusOffset === anchorOffset) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blockIndex + 1
이 디폴트 값 아닌가용?🤔
frontend/src/hooks/useManager.tsx
Outdated
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); | ||
// } | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
캐럿 로직 복잡하네용..ㅠ
버그 수정 및 서버 동기화 로직 적용
해당 이슈 📎
#134 #118
변경 사항 🛠
구현내용 요약
테스트 ✨
없음
리뷰어 참고 사항 🙋♀️