Flat Message Layout

This commit is contained in:
현성필
2024-05-13 20:37:49 +09:00
parent a87f59dfd8
commit 2c93df5615
3 changed files with 4 additions and 9 deletions
@@ -165,7 +165,6 @@ class EditableInputController {
if (content === '\u200B') {
return 0; // Return 0 if the content is only the zero-width space character
}
console.log(content);
return content.replace('\u200B', '').length;
}
@@ -206,10 +205,8 @@ class EditableInputController {
const nodeStack = [element];
let node, foundStart = false, stop = false;
let charIndex = 0;
console.log('restoreCursor', position);
while (!stop && (node = nodeStack.pop())) {
if (node.nodeType === 3) {
console.log(node);
const nextCharIndex = charIndex + node.length;
if (!foundStart && position >= charIndex && position <= nextCharIndex) {
range.setStart(node, position - charIndex);