Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test for MaxLengthPlugin #2296

Merged
merged 1 commit into from
May 30, 2022
Merged

Conversation

im-adithya
Copy link
Contributor

Adds e2e for #2255

lexical-.3.mp4

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 30, 2022
@vercel
Copy link

vercel bot commented May 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview May 30, 2022 at 0:19AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview May 30, 2022 at 0:19AM (UTC)

Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, additional stuff you can test:

  1. Selection
  2. Pasting text on an empty/non-empty editor
  3. IME on boundaries
  4. Emojis (that can have variable size)

@zurfyx zurfyx merged commit 7c9ab4c into facebook:main May 30, 2022
@im-adithya
Copy link
Contributor Author

Thanks for the inputs @zurfyx! This helped me find a bug(?) in MaxLengthPlugin.
I'm not quite sure because I don't exactly know how emojis work in lexical. As far as the issue is concerned, it is as follows:

lexical-.4.mp4
  1. Type any random 30 characters
  2. Copy this emoji 💏 or any other emoji of length 2 (occupying a length of 2, otherwise this emoji is actually of length 11 as shown by '💏'.length which also can be an error if lexical is supposed to treat this as an 11-length emoji, but a....a💏 (28 as) works fine in MaxLength)
  3. Remove a character and paste the emoji at the end (and ONLY at the end, otherwise the behavior is proper)

The entire editor gets cleared and the Block Format dropdown disappears! (I've found out that it is because the blockType of editor gets changed to root after being cleared)

I would like to work on this after getting to know a bit more about emoji guidelines as that would help in a better understanding of the functionality!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants