Complete the code to create a connection on click in Figma.
figma.currentPage.selection[0].on('click', () => [1]);
Using createConnection() inside the click event handler creates a connection when the user clicks.
Complete the code to show a connection highlight on hover.
figma.currentPage.selection[0].on('hover', () => [1]);
The showHighlight() function is used to visually highlight the connection when hovered.
Fix the error in the code to properly create a connection on click.
figma.currentPage.selection[0].on('click', () => [1]);
The function createConnection() must be called with parentheses inside the arrow function.
Fill both blanks to create a connection on click and remove highlight on hover end.
figma.currentPage.selection[0].on('click', () => [1]); figma.currentPage.selection[0].on('hoverend', () => [2]);
Click triggers createConnection() and hover end triggers removeHighlight() to clear the highlight.
Fill all three blanks to create a connection on click, show highlight on hover, and remove highlight on hover end.
figma.currentPage.selection[0].on('click', () => [1]); figma.currentPage.selection[0].on('hover', () => [2]); figma.currentPage.selection[0].on('hoverend', () => [3]);
Click creates the connection, hover shows highlight, and hover end removes highlight for a smooth user experience.