Git Product home page Git Product logo

Comments (4)

steveluscher avatar steveluscher commented on August 17, 2024

To be clear, I don't think that the presence of a tab should spawn a new block (edit: text node) at all.

from lexical.

trueadm avatar trueadm commented on August 17, 2024

@steveluscher please could you also paste in the step recorder output test case? Might as well use it given we have it!

from lexical.

steveluscher avatar steveluscher commented on August 17, 2024
{
  name: '<YOUR TEST NAME>',
  inputs: [
    insertText("v"),
    moveNativeSelection([0,0,0],2,[0,0,0],2),
    insertText("C"),
    deleteWordForward()
  ],
  expectedHTML: '<div contenteditable="true" data-outline-editor="true"><p class="editor-paragraph" dir="ltr"><span>ABC</span><span></span><span>EFG</span></p></div>',
  expectedSelection: {
    anchorPath: [0,1,0],
    anchorOffset: 0,
    focusPath: [0,1,0],
    focusOffset: 0,
  },
},

The insertText("v") isn't really accurate. That was the clipboard paste. You can file that as another bug if you like :)

The problem is that you can't type tabs in the example app. I have to paste.

from lexical.

trueadm avatar trueadm commented on August 17, 2024

Looks like the reason we split up the text node into multiple blocks on the first paste is because of the useMentions hook. As there are capital letters, it prepares the text for potentially needing to be a mention. The reason it happens again is because of the useMentions plugin again, applying a split. I'll look into how the plugin can undo it's split when it detects no results :)

from lexical.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.