Comments (4)
@steveluscher what do you think we should do here? Go down the route of copying Quip?
from lexical.
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.
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.
@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)
- Bug: Table is not deleted correctly when selected by shift + arrowup HOT 2
- Slack Dropzone Plugin HOT 2
- Docs: Replace lingering references of GridSelection with TableSelection
- Bug: @lexical/react 0.14.4 brings in @lexical/devtools-core dependency without declaring it HOT 6
- Bug: Collapsible container is not properly deserialized HOT 6
- Docs: Add FAQs about hot module reloading HOT 1
- Bug: API modules list HOT 1
- Docs: Generate docusaurus sidebars from filesystem
- Bug: private module 'shared' is referenced in shipped type declarations HOT 1
- Feature: Use api-extractor when generating the .d.ts files for distribution HOT 4
- Feature: escape key handler for plain text plugin
- TODO: Add a test for mouse leaving browser window during table selection HOT 1
- Proposal: DecoratorElementNode HOT 10
- Bug: (Firefox) Caret disappears after dragging a block HOT 2
- Bug: Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read(). HOT 3
- Refactor: Move AutoCompleteNode styling to theme.
- Docs: add release management process to the maintainers guide
- Consider DecoratorNode in $insertNodeToNearestRoot
- Bug: LexicalClipboard pasting over mention crashes Chrome HOT 2
- How to keep styles between lines? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lexical.