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

Cannot Copy Text Inside an Input in a Void Element #5366

Closed
dpizzo-at-aops opened this issue Mar 16, 2023 · 0 comments · Fixed by #5369
Closed

Cannot Copy Text Inside an Input in a Void Element #5366

dpizzo-at-aops opened this issue Mar 16, 2023 · 0 comments · Fixed by #5369
Labels

Comments

@dpizzo-at-aops
Copy link

Description

Cannot copy text out of an input inside a void.

It looks like #5121 broke the ability to copy text from within an <input type="text"/> within a void element (looks like #5294 might also be related). Someone in that latter issue commented:

I know why cannot copy content in input box. Because it's a void element. This is the default rule of slate.

Is there any workaround?

Recording
This is on the live example at https://www.slatejs.org/examples/editable-voids:

Screen.Recording.2023-03-16.at.10.11.15.AM.mov

Sandbox
The editable-voids example on the site has this issue: https://www.slatejs.org/examples/editable-voids

Steps
To reproduce the behavior:

  1. Go to https://www.slatejs.org/examples/editable-voids
  2. Type anything in the "Name:" input box at the top of the editable void.
  3. Select text within that input box and copy it.
  4. Try to paste it within slate -- it will paste an entirely new editable void instead.
  5. Try to paste it anywhere else -- it will paste 2 new-line characters (or something else unrelated)

Expectation

If I copy the text (as in step 3) and paste it anywhere, it should paste properly as plaintext.

Environment

Context

It seems like a choice was made in #5121 that broke this to fix a more common use-case. May also be related to #5294?

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

Successfully merging a pull request may close this issue.

1 participant