GithubHelp home page GithubHelp logo

Comments (4)

trueadm avatar trueadm commented on April 25, 2024 1

@steveluscher what do you think we should do here? Go down the route of copying Quip?

from lexical.

trueadm avatar trueadm commented on April 25, 2024

Interestingly, this how it also works in Gmail, Slate, ProseMirror, Quill and Draft. In fact, this is how it works everywhere but Quip. Google Docs implements their own custom highlight to look native-like.

from lexical.

steveluscher avatar steveluscher commented on April 25, 2024

It's not selecting a ghost character, it's selecting ‘the fact of the break,’ right?

Here's TextEdit on Mac OS.

Screen.Recording.2021-03-11.at.12.06.15.PM.mov

And a ‘raw’ contenteditable div in Mac Chrome (https://jsbin.com/wogijuhewu/edit?html,js,output)

Screen.Recording.2021-03-11.at.12.09.31.PM.mov

When you copy and paste the result of that selection into a plain text editor you get:

A

B

…as you might expect based on the semantics of what a break is.

If there's anything we could do better here it would be to make the selection of what you've called a ‘ghost character’ actually visible when you include it in the selection.

Thoughts?

from lexical.

trueadm avatar trueadm commented on April 25, 2024

@steveluscher Thanks for the detailed clarification. I don't think we should do anything here – as going above and beyond will increase the code size for little benefit IMO. This is how it looks on almost every website, and the ones where it doesn't means they've implemented their own hint at the line break.

Note: if you do a soft line break, and let the editor select the <br>, you get the same effect.

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.