Flat Message Layout
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user