BlockNote
BlockNote copied to clipboard
Setting Text Cursor Position
I'm experiencing an issue with setting the text cursor position. I mentioned that the cursor position is not changing. Can you confirm if there is a syntax error in the code provided? Here's the code snippet that you have shared:
const navigate = () => {
const filterContent = "Abhinav";
const filteredIds = editor.document
.filter((obj) =>
obj.content.some((item) => item.text.includes(filterContent))
)
.map((obj) => obj.id);
//console.log(editor.document);
//console.log(filteredIds[0]);
editor.setTextCursorPosition(filteredIds[0], "end");
};
Please let me know if there's anything else.