BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Setting Text Cursor Position

Open abhinavshyju opened this issue 3 months ago • 0 comments

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.

abhinavshyju avatar Mar 28 '24 07:03 abhinavshyju