Questions tagged [lexicaljs]

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.

Website

https://lexical.dev/

Playground

https://playground.lexical.dev/

Docs

https://lexical.dev/docs/intro

Syntax

<LexicalComposer initialConfig={editorConfig}>
  <div className="editor-container">
    <PlainTextPlugin
      contentEditable={<ContentEditable className="editor-input" />}
      placeholder={<Placeholder />}
      ErrorBoundary={LexicalErrorBoundary}
    />
    <OnChangePlugin onChange={onChange} />
    <HistoryPlugin />
    <TreeViewPlugin />
    <EmoticonPlugin />
    <MyCustomAutoFocusPlugin />
  </div>
</LexicalComposer>
85 questions
0
votes
0 answers

How to test lexical toolbar command dispatch within jest/react?

Following a guide, I created a lexical toolbar component in React that changes the format of text eg. bold, underline, italic, and list. Unfortunately, the team im working with wants 100% code coverage so im trying to finish up some tests for this…
syn
  • 11
  • 2
0
votes
1 answer

How to get ref to a selected link text

I have lexical editor, and I want to get reference of a link currently selected/clicked (so that I can position a layover on top of it for the purpose of editing the link) using react? For example, "link" in the below text. This is a lexicaljs text…
ZiCode
  • 19
  • 6
0
votes
0 answers

Confusing Error:- Function components cannot have string refs. We recommend using useRef() instead

Creating a ref via useRef(): export default function LexicalEditor() { const floatingAnchorElem = useRef(null); return(
ZiCode
  • 19
  • 6
0
votes
0 answers

How to set width and height to a richtextbox and do not grow rather hide overflow

I'm using Lexical with React, when use same logic as shown on playground I can see the size of the richtextbox is determined by how big my toolbar is. If I don't want a toolbar, where should I set a width and height for initial richtextbox? And is…
YYT
  • 33
  • 2
0
votes
0 answers

Implementing Lexical editor on Vue 2

I know there's Lexical-Vue that is built around Vue 3. But I want to try implementing it on Vue 2 app and it's apparently not working well. The error says I need an appropriate loader for Lexical module but I'm not quite sure what it wants. My…
Intaek
  • 315
  • 4
  • 15
0
votes
0 answers

How can I keep inline styles when using $insertNodes?

I have got a question on how to customize serialization. For my current project, I need to insert html into the editor with custom