Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-pasting text with an inline void from Slate to other editors is not working as expected. #4802

Open
laufeyrut opened this issue Jan 24, 2022 · 3 comments
Labels

Comments

@laufeyrut
Copy link
Contributor

Description
Copy-pasting text with an inline void from Slate to other editors is not working as expected.

Recording
https://user-images.githubusercontent.com/15036127/150869415-33422c13-2666-4e58-9104-2464474b7107.mov

Steps
To reproduce the behavior:

  1. Go to https://www.slatejs.org/examples/mentions
  2. Copy the text from the example
  3. Paste the text to some editor. Like Google Docs or notes.
  4. There is a new line after each inline element

Screenshot 2022-01-24 at 20 53 56

Screenshot 2022-01-24 at 20 53 30

Expectation
That and new line is not added after inline elements
Screenshot 2022-01-24 at 21 10 57

Environment

  • Slate Version: [0.72.3
  • Operating System: MacOs 11.6.2
  • Browser: Microsoft Edge
@laufeyrut laufeyrut added the bug label Jan 24, 2022
@jackmiller2708
Copy link

@laufeyrut I agree. As of right now, Slate is using the zero width no-break space (U+FEFF), which is deprecated. They should switch up the default to word joiner (U+2060) to represent void characters instead.

@yume-chan
Copy link
Contributor

yume-chan commented Nov 24, 2022

Using U+2060 won't fix the issue in Google Docs. It's caused by this position: absolute style:

<Tag
data-slate-spacer
style={{
height: '0',
color: 'transparent',
outline: 'none',
position: 'absolute',
}}
>
<Text
renderPlaceholder={renderPlaceholder}
decorations={[]}
isLast={false}
parent={element}
text={text}
/>
</Tag>

@yume-chan
Copy link
Contributor

Use U+2060: #2597, use <br>: #1971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants