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.

Errors deleting links on the link example

See original GitHub issue

Hi @ianstormtaylor! On the link example, in the following two cases, I see errors and unexpected behavior:

First Case (steps)

slate-link-3

  1. Select-all text.
  2. Press delete.
  3. In the empty editor, type in a word.
  4. Select, and click on link button.
  5. Enter a url
  6. Go to the end of the word and try to delete or highlight and try to delete.
  7. Check console.

The following errors should show up:

Uncaught TypeError: Cannot read property 'length' of undefined
    at Object.deleteBackwardAtRange (http://slatejs.org/build.prod.js:18329:32)
    at Transform.(anonymous function) [as deleteBackwardAtRange] (http://slatejs.org/build.prod.js:14125:32)
    at Object.deleteCharBackwardAtRange (http://slatejs.org/build.prod.js:18177:13)
    at Transform.(anonymous function) [as deleteCharBackwardAtRange] (http://slatejs.org/build.prod.js:14125:32)
    at Object.deleteCharBackward (http://slatejs.org/build.prod.js:17546:13)
    at Transform.(anonymous function) [as deleteCharBackward] (http://slatejs.org/build.prod.js:14125:32)
    at onKeyDownBackspace (http://slatejs.org/build.prod.js:14672:63)
    at Stack.(anonymous function) [as onKeyDown] (http://slatejs.org/build.prod.js:12580:37)
    at Object._this.(anonymous function) [as onKeyDown] (http://slatejs.org/build.prod.js:6505:70)
    at onKeyDown (http://slatejs.org/build.prod.js:6156:18)

Second Case

slate-link-1 slate-link-2

  1. Highlight the last word ‘selected’.
  2. Add a link.
  3. Move the cursor to the right, past the period.
  4. Now observe two issues
  5. Highlight from the end of the line including the period and the link and try to backspace. Random fragments are being deleted and selection still remains expanded.
  6. Now try the above steps but try backspacing without highlighting and you’ll see that the period is not being deleted.

On the positive side, no console errors are showing up though.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
anges244commented, Apr 13, 2021

This is now an issue again. To replicate open the Link Example, remove the link with backspace and right click to inspect the elements. It remains without a text. Is there a workaround for this?

Screenshot 2021-04-13 at 6 50 33 PM
0reactions
oyeanujcommented, Aug 2, 2017

It seems that out of the 3, the first 2 issues have been resolved in subsequent releases, yay! Only the third issue persists -

image

  1. Highlight the last word ‘selected’.
  2. Add a link.
  3. Move the cursor to the right, past the period.
  4. Now try the above steps but try backspacing without highlighting and you’ll see that the period is not being deleted.

Haven’t looked further yet to see if it is an edge case or symptom of something else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Find and Remove Broken Links in Your Website | WebFX
404 errors and broken links can have negative effects on the amount of traffic on your site. Learn how to find and remove...
Read more >
What are Broken Links? And How Do You Find and Fix Them?
Examples of a broken link error code ... Bad URL: Malformed URL (e.g. a missing bracket, extra slashes, wrong protocol, etc.) ... Reset:...
Read more >
How to Find and Remove Broken Links from Your Website
Step 1: Generate a Report for Broken Links ... Finding broken links with Google Analytics requires two different approaches regarding internal and ...
Read more >
Internet Tips: Tips for Fixing Broken Links - GCF Global
Learn how to fix a broken link in this free lesson, which offers several tips for fixing broken links.
Read more >
How to Fix (Or Remove) Broken Links on Your WordPress ...
They occur for quite a few reasons, but mostly when the link's URL points to a domain that no longer exists, has unusual...
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