question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Does it really work without react?

See original GitHub issue

Hello there,

thanks for this nice editor-library. I came across some issues during implementing lexical with plain vanilla js app. The code can be found here: https://codesandbox.io/s/lexical-vanilla-js-i05utt

As you can see, the editor does not take the pressed key as an input. If you add:


editor.update(() => {
  const root = $getRoot();
  const paraNode = $createParagraphNode();
  const textNode = $createTextNode('Hello World');
  paraNode.append(textNode);
  root.append(paraNode);

there will be text inside the editor, but its neither possible to use the backspace (no chars will be deleted) nor to use enter (to add a new paragraph).

Did i something wrong? Or is there a bug with using lexical in a vanilla js-environment?

Best regards

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
digitalgopnikcommented, Jun 2, 2022

@trueadm Thanks for your ultra quick response 😃

Could be maybe helpful for lexical newcomers who come across the same issue to have an example with vanilla js. If you don’t mind i would extend my sandbox and create a pull request which a link inside the readme to have an example in plain javascript?

0reactions
lyovecommented, Nov 29, 2022

registerRichText(editor, initialEditorState);

This is simple example https://github.com/lyove/lexical-vanilla

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yes, React is taking over front-end development. The question ...
React does not assume anything about the other parts in any full solution. It focuses on just one thing, and on doing that...
Read more >
Material-UI without React / just with vanilla HTML, CSS & JS ...
No, you cannot use Material-UI without React. Material-UI is a library of React components. There is not a way to use the CSS...
Read more >
React Without ES6
React provides lifecycle methods that let you know when a component is about to be created or destroyed.
Read more >
Thinking in React
React is, in our opinion, the premier way to build big, fast Web apps with JavaScript. It has scaled very well for us...
Read more >
Introducing Hooks - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. ... This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found