facebook / facebook/lexical

Bug: Figma Plugin Example in CodeSandbox

Open
#4,476 3 comments 0 reactions 0 assignees View on GitHub
all-platforms-bug other
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

Identified a bug on the Demos page of project website in the "Plugin examples > embed plugins > Figma plugin example in codeSandbox" section. Specifically, the issue occurs when clicking on the "Insert Figma File" button.

Normally, a warning message should pop up asking users to paste the link for their Figma file. However, we have found that the warning message is currently displaying an incorrect instruction. Instead of asking users to paste the link to their Figma file, it states to paste the link for a YouTube video. This can be confusing for users.

Lexical version: v0.10.0

## Steps To Reproduce

1. Go to the Demos page of the open-source project
2. Navigate to the Plugin examples section and click on "embed plugins"
3. Click on the Figma plugin example in CodeSandbox
4. Click on the "Insert Figma file" button
5. Note that a warning appears asking to paste a YouTube link instead of a Figma link.

## Code example:
[Link of the CodeSandbox](https://codesandbox.io/embed/lexical-figma-plugin-example-0dphp4?fontsize=14&hidenavigation=1&module=/src/Editor.js,/src/plugins/FigmaPlugin.tsx,/src/nodes/FigmaNode.tsx&theme=dark&view=split)

To fix for the issue. In the `FigmaToolbar.tsx` file located in the **plugins** folder of the CodeSandbox example, there is a line of code that is causing the issue.

`const text = prompt("Enter the URL of the Youtube video:", "");`

The corrected code should look like this:

`const text = prompt("Enter the URL of the Figma file:", "");`

## The current behavior
![ezgif com-crop](https://github.com/facebook/lexical/assets/93304640/f63b0c82-6801-4f60-ae2b-54f883d9ba2d)

## The expected behavior
![ezgif com-crop (2)](https://github.com/facebook/lexical/assets/93304640/9479d4be-e2b3-4832-824f-5ba2c1613802)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.