question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Editor's selection points to non-existing location when value is changed programmatically (Chrome, Safari)

See original GitHub issue

Do you want to request a feature or report a bug?

Bug.

What’s the current behavior?

Peek 2020-09-16 19-15

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

  1. Focus the last paragraph in the example
  2. Click “Reset” button

useSlate().selection points to a non-existing location (location after performing step (1))

Slate: 0.58.4 Browser: Chrome, Safari OS: Windows, Linux, Mac

What’s the expected behavior?

useSlate().selection points to an existing location.

Works fine in Firefox.

Peek 2020-09-16 19-18

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DaniGuardiolacommented, Nov 3, 2021

@e1himself on a second thought, it might not be necessary to distinguish those, but I’m still worried that it’ll be already too late and the editor would’ve crashed by then, since the value would’ve been applied already.

1reaction
DaniGuardiolacommented, Nov 3, 2021

@e1himself yep, I think that’s the problem with that fix, I don’t think there a good way to tell which is which.

@kamilmielnik in our case we have quite a few places where we’re accessing the selection, so checking everywhere would be a little messy 😕 thx for sharing though!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editing Code to Change Your Webpage - Apple Developer
Add the position property by entering position: fixed; Press Command-S to save the file with the new position property. You can save any...
Read more >
Open Safari / Google Chrome developer tools ...
I need solutions for both Google Chrome and Safari, that will open the developer-tools pane if it's not already open, and (hopefully, if...
Read more >
FCKeditor ChangeLog - What's New?
InsertHtml() will now insert to the last selected position after the user has selected ... It will move the focus out of the...
Read more >
Jitbit Helpdesk - release history
"Big" support widget script - support for pre-selected ticket category ... UI when a project is changed; DevOps integration now supports rich text...
Read more >
Customizing and Extending IBM Content Navigator
plug-in with basic extension points of IBM Content Navigator” which covers ... Look up the choice list values for a property or dependent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found