In my plugin, there is a list of elements. Where the user clicks on any element, the element should be focused on.
Right now I’m saving the ids of nodes, and then calling the
// id is known let node = figma.currentPage.findOne(n => n.id === id); figma.currentPage.selection = [node]; figma.viewport.scrollAndZoomIntoView([node]);
But as it said in the docs, the search with
node.findOne can be slow when used on large Figma projects.
How can I speed up this process? Should I save the node objects when forming the list, or there is a better way?
I’d really appreciate it if you would help!