조사할 것
model selection이 항상 native DOM selection으로 그대로 보이면 안 되는 경우가 있다. hidden selection class, cursor wrapper, node selection 표시를 어떤 lifecycle로 관리해야 하는지 조사한다.
prosemirror-view 근거
우리 에디터에서 확인할 것
- block selection, figure selection, mention selection이 native selection과 overlay selection 중 무엇으로 표현되어야 하는지 정한다.
- selection hidden class가 focus/blur, drag, toolbar click 뒤에 남지 않는지 확인한다.
완료 기준
조사할 것
model selection이 항상 native DOM selection으로 그대로 보이면 안 되는 경우가 있다. hidden selection class, cursor wrapper, node selection 표시를 어떤 lifecycle로 관리해야 하는지 조사한다.
prosemirror-view 근거
selectionToDOM은NodeSelection표시를 sync한 뒤 editor가 selection을 소유할 때만 DOM selection을 갱신한다.https://github.com/ProseMirror/prosemirror-view/blob/ca4c78e9b56f1b164c0b3758b59d8748f11b7534/src/selection.ts#L55-L76
ProseMirror-hideselectionclass를 붙이고 selectionchange 후 지연 제거한다.https://github.com/ProseMirror/prosemirror-view/blob/ca4c78e9b56f1b164c0b3758b59d8748f11b7534/src/selection.ts#L92-L147
https://github.com/ProseMirror/prosemirror-view/blob/ca4c78e9b56f1b164c0b3758b59d8748f11b7534/src/selection.ts#L149-L164
selectNode/deselectNodehook으로 DOM state를 정리한다.https://github.com/ProseMirror/prosemirror-view/blob/ca4c78e9b56f1b164c0b3758b59d8748f11b7534/src/selection.ts#L166-L185
우리 에디터에서 확인할 것
완료 기준