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

Mention nodes shouldn't be spellcheck'd :) #6788

Merged
merged 4 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ test.describe('Clear All Formatting', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -180,6 +181,7 @@ test.describe('Clear All Formatting', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ test.describe('Composition', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -950,6 +951,7 @@ test.describe('Composition', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2)"
data-lexical-text="true">
Luke Skywalker
Expand Down
33 changes: 33 additions & 0 deletions packages/lexical-playground/__tests__/e2e/Mentions.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -137,6 +138,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -168,6 +170,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -232,6 +235,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -264,6 +268,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Skywalker
Expand Down Expand Up @@ -308,6 +313,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -340,6 +346,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -384,6 +391,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -407,6 +415,7 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -486,6 +495,7 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">abc</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -511,6 +521,7 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">abc</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke
Expand Down Expand Up @@ -590,27 +601,31 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -646,20 +661,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -677,20 +695,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -714,20 +735,23 @@ test.describe('Mentions', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -743,20 +767,23 @@ test.describe('Mentions', () => {
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -783,13 +810,15 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -807,13 +836,15 @@ test.describe('Mentions', () => {
<span data-lexical-text="true">Skywalker</span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
</span>
<span data-lexical-text="true"></span>
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -879,6 +910,7 @@ test.describe('Mentions', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down Expand Up @@ -971,6 +1003,7 @@ test.describe('Mentions', () => {
dir="ltr">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test.describe('Regression test #379', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand All @@ -57,6 +58,7 @@ test.describe('Regression test #379', () => {
<p class="PlaygroundEditorTheme__paragraph">
<span
class="mention"
spellcheck="false"
style="background-color: rgba(24, 119, 232, 0.2);"
data-lexical-text="true">
Luke Skywalker
Expand Down
1 change: 1 addition & 0 deletions packages/lexical-playground/src/nodes/MentionNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class MentionNode extends TextNode {
const dom = super.createDOM(config);
dom.style.cssText = mentionStyle;
dom.className = 'mention';
dom.spellcheck = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like a low risk change

return dom;
}

Expand Down
Loading