Skip to content

Commit bb9fb20

Browse files
[lexical] Fix: ctrl+a doesn't work well in plain text mode on Firefox (#7579)
Co-authored-by: Bob Ippolito <bob@redivi.com>
1 parent 6da5974 commit bb9fb20

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/lexical-playground/__tests__/e2e/CopyAndPaste/lexical/CopyAndPaste.spec.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test.describe('CopyAndPaste', () => {
103103
</p>
104104
`,
105105
);
106-
if (browserName === 'firefox') {
106+
if (browserName === 'firefox' && IS_LINUX) {
107107
await assertSelection(page, {
108108
anchorOffset: 0,
109109
anchorPath: [],
@@ -132,7 +132,7 @@ test.describe('CopyAndPaste', () => {
132132
</p>
133133
`,
134134
);
135-
if (browserName === 'firefox') {
135+
if (browserName === 'firefox' && IS_LINUX) {
136136
await assertSelection(page, {
137137
anchorOffset: 0,
138138
anchorPath: [],
@@ -433,7 +433,7 @@ test.describe('CopyAndPaste', () => {
433433
await selectAll(page);
434434

435435
if (isRichText) {
436-
if (browserName === 'firefox') {
436+
if (browserName === 'firefox' && IS_LINUX) {
437437
await assertSelection(page, {
438438
anchorOffset: 0,
439439
anchorPath: [],
@@ -449,7 +449,7 @@ test.describe('CopyAndPaste', () => {
449449
});
450450
}
451451
} else {
452-
if (browserName === 'firefox') {
452+
if (browserName === 'firefox' && IS_LINUX) {
453453
await assertSelection(page, {
454454
anchorOffset: 0,
455455
anchorPath: [],
@@ -731,15 +731,15 @@ test.describe('CopyAndPaste', () => {
731731
await selectAll(page);
732732

733733
if (isRichText) {
734-
if (browserName === 'firefox') {
734+
if (browserName === 'firefox' && IS_LINUX) {
735735
await assertSelection(page, {
736736
anchorOffset: 0,
737737
anchorPath: [],
738738
focusOffset: 2,
739739
focusPath: [],
740740
});
741741
} else {
742-
if (browserName === 'firefox') {
742+
if (browserName === 'firefox' && IS_LINUX) {
743743
await assertSelection(page, {
744744
anchorOffset: 0,
745745
anchorPath: [0, 0, 0],
@@ -756,7 +756,7 @@ test.describe('CopyAndPaste', () => {
756756
}
757757
}
758758
} else {
759-
if (browserName === 'firefox') {
759+
if (browserName === 'firefox' && IS_LINUX) {
760760
await assertSelection(page, {
761761
anchorOffset: 0,
762762
anchorPath: [],

packages/lexical/src/LexicalEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ function onKeyDown(event: KeyboardEvent, editor: LexicalEditor): void {
12161216
event.preventDefault();
12171217
dispatchCommand(editor, SELECT_ALL_COMMAND, event);
12181218
}
1219-
} else if (!IS_FIREFOX && isSelectAll(event)) {
1219+
} else if (isSelectAll(event)) {
12201220
event.preventDefault();
12211221
dispatchCommand(editor, SELECT_ALL_COMMAND, event);
12221222
}

0 commit comments

Comments
 (0)