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: Unexpected behavior with transform selected lines to code block
- Bug: mention deleting one by one HOT 1
- Bug: Table height is not exported to json
- Bug: Editor lost its own selection when focus set inside external dialogs
- Bug: Font size highlight removed on input
- Feature: Option to set match order to LexicalTypeaheadMenuPlugin and LexicalMenu
- Feature: How can I add mark tag when use generateHtmlFromNodes
- Bug: Bulleting an image when image is selected crashes
- Bug: EditorRefPlugin triggers endless rendering with function containing setState
- Bug: Typing an invalid or partially valid hashtag followed by a valid hashtag causes infinite transform execution HOT 3
- Bug: Indentation in Markdown is not being reflected HOT 2
- ElementNode format
- Bug: AutoFocusPlugin does not work with markdown.
- Bug: some types are imported as any HOT 4
- Feature: React 16 Support HOT 2
- Bug: Dragging an image onto the same line crashes
- There is no className variable in the context of this docs copy-pasta
- Bug: failure to build with Webpack due to "Module not found: Error: Default condition should be last one" [regression] HOT 2
- Bug: Horizontal Rule node or Page break node selection problem
- Bug: ComponentPickerPlugin scrolling is buggy - dropdown disappears onScroll HOT 1
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.