Skip to content

Commit 018c193

Browse files
authored
fix(richtext-lexical): allow any priority of FOCUS_COMMAND (#10128)
This revert patch behavior on indent in Firefox, in order to fix #10049
1 parent 510968f commit 018c193

File tree

4 files changed

+5
-69
lines changed

4 files changed

+5
-69
lines changed

packages/richtext-lexical/src/features/indent/client/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
'use client'
22

3+
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'
34
import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'
45

56
import type { ToolbarGroup } from '../../toolbars/types.js'
67

78
import { IndentDecreaseIcon } from '../../../lexical/ui/icons/IndentDecrease/index.js'
89
import { IndentIncreaseIcon } from '../../../lexical/ui/icons/IndentIncrease/index.js'
910
import { createClientFeature } from '../../../utilities/createClientFeature.js'
10-
import { IndentPlugin } from './plugins/index.js'
1111
import { toolbarIndentGroupWithItems } from './toolbarIndentGroup.js'
1212

1313
const toolbarGroups: ToolbarGroup[] = [
@@ -58,7 +58,7 @@ const toolbarGroups: ToolbarGroup[] = [
5858
export const IndentFeatureClient = createClientFeature({
5959
plugins: [
6060
{
61-
Component: IndentPlugin,
61+
Component: TabIndentationPlugin,
6262
position: 'normal',
6363
},
6464
],

packages/richtext-lexical/src/features/indent/client/plugins/index.tsx

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/richtext-lexical/src/lexical/LexicalEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const LexicalEditor: React.FC<
114114
<RichTextPlugin
115115
contentEditable={
116116
<div className="editor-scroller">
117-
<div className="editor" ref={onRef} tabIndex={-1}>
117+
<div className="editor" ref={onRef}>
118118
<LexicalContentEditable editorConfig={editorConfig} />
119119
</div>
120120
</div>

test/fields/collections/Lexical/e2e/main/e2e.spec.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,8 @@ describe('lexicalMain', () => {
784784
})
785785
})
786786

787-
/**
788-
* When the escape key is pressed, Firefox resets the active element to the beginning of the page instead of staying with the editor.
789-
* By applying a keydown listener when the escape key is pressed, we can programatically focus the previous element if shift+tab is pressed.
790-
*/
791-
test('ensure escape key can be used to move focus away from editor', async () => {
787+
// NOTE: It's not worth it right now. Maybe later. See https://github.com/payloadcms/payload/issues/10049
788+
test.skip('ensure escape key can be used to move focus away from editor', async () => {
792789
await navigateToLexicalFields()
793790

794791
const richTextField = page.locator('.rich-text-lexical').first()

0 commit comments

Comments
 (0)