Skip to content

Commit

Permalink
Mention nodes shouldn't be spellcheck'd :) (#6788)
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Ippolito <[email protected]>
Co-authored-by: Sherry Wong <[email protected]>
Co-authored-by: Sherry <[email protected]>
  • Loading branch information
4 people authored Nov 11, 2024
1 parent 2bdaed5 commit 23f4a7e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
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;
return dom;
}

Expand Down

0 comments on commit 23f4a7e

Please sign in to comment.