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

Placeholder text slow to re-appear after content has been cleared #5420

Open
endercrest opened this issue May 11, 2023 · 6 comments
Open

Placeholder text slow to re-appear after content has been cleared #5420

endercrest opened this issue May 11, 2023 · 6 comments
Labels

Comments

@endercrest
Copy link

Description
Previously, clearing text would have the placeholder text appear again instantly. However, in 0.94.0 (and possibly 0.93.0) that placeholder takes some time to re-appear.

The placeholder works as expected in 0.92.0.

Recording
A GIF or video showing the issue happening. (If you don't include this, there's a very good chance your issue will be closed, because it's much too hard to figure out exactly what is going wrong, and it makes maintenance much harder.)

Screen.Recording.2023-05-11.at.3.33.40.PM.mov

Sandbox
https://codesandbox.io/s/slate-reproductions-forked-bufv30?file=/index.js

Steps

  1. Create slate editor with placeholder
  2. type text in
  3. remove text

This can also be replicated on the official examples: https://www.slatejs.org/examples/richtext

Expectation
I would have expected that the placeholder text to re-appear immediately after the text is cleared.

Video on slate-react on 0.92.0

Screen.Recording.2023-05-11.at.3.39.52.PM.mov

Environment

  • Slate Version: 0.94.0
  • Operating System: macOS
  • Browser: Chrome

Context
Just updated to the latest version from 0.88.1 and noticed this immediately.

@endercrest endercrest added the bug label May 11, 2023
@josephmr
Copy link
Contributor

I'm seeing this as well. Tracked it down to slate-react 0.93.0. Most likely from 5a0d397

Also causes some additional issues with my specific Slate editor inside a webview on native where the delayed placeholder after deletion causes the cursor to disappear then subsequent deletes break the editor. This was not the case before slate-react 0.93.0 when the placeholder rendered immediately.

slate-react 0.92.0

Simulator.Screen.Recording.-.iPhone.14.-.2023-05-18.at.15.53.19.mp4

slate-react 0.93.0

Simulator.Screen.Recording.-.iPhone.14.-.2023-05-18.at.15.50.26.mp4

@wfischer42
Copy link

wfischer42 commented Jun 5, 2023

I'm seeing this as well. Tracked it down to slate-react 0.93.0. Most likely from 5a0d397

Yeah, it's explicitly waiting 300 ms to show, which seems like an exceptionally long time for the purpose of allowing selections to settle. I wonder what the case is where that would take more than a couple milliseconds?

@edify-jashmore
Copy link

@edhager do you have any thoughts on this one? About the placeholder delay

@Arkellys
Copy link

I agree with the others, 300ms is way too long. It's visually distracting and It looks like a bug. Is it possible to remove this delay?

@davisg123
Copy link

+1 this is impacting our app

@Arkellys
Copy link

Fixed for non-android devices with this PR available on [email protected]

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

6 participants