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.

This Selection object doesn't have any Ranges

See original GitHub issue

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

What is the current behavior? When adding a custom component via AtomicBlockUtils.insertAtomicBlock and then clicking on it, the following error is logged to the console:

Uncaught DOMException: Failed to execute 'extend' on 'Selection']
    at addFocusToSelection
    at setDraftEditorSelection
    at DraftEditorLeaf._setSelection
    at DraftEditorLeaf.componentDidUpdate
    at measureLifeCyclePerf
    at CallbackQueue.notifyAll
    at ReactReconcileTransaction.close
    at ReactReconcileTransaction.closeAll
    at ReactReconcileTransaction.perform

this error is tracked down to following moudle: setDraftEditorSelection.js: selection.extend(node, offset)

Which versions of Draft.js, and which browser / OS are affected by this issue? Chrome Version 58.0.3029.81 Draft-js Version 0.10.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:29
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
kwarr128commented, May 5, 2017

My colleague had the same issue and I wasn’t, we narrowed down that the only difference was our Chrome versions. I was on 57 and they were on 58. I also started getting the issue after upgrading to Chrome 58.

Additionally, it only seems to be happening when we have two editors rendered at the same time

6reactions
dirkholsopplecommented, May 5, 2017

Attempted to fix this by checking for selection type ‘None’ before extending the Selection https://github.com/facebook/draft-js/pull/1192

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selection and Range - The Modern JavaScript Tutorial
The underlying Range and Selection objects are easy to grasp, and then you'll need no recipes to make them do what you want....
Read more >
Select method of Range class failed via VBA - Stack Overflow
The error, Method 'Range' of object '_Worksheet' failed, error 1004, that you're getting is because the sheet with the button on it doesn't...
Read more >
VBA – Test if Selection is a Range or Object - Automate Excel
If you are working with a user selected Range in VBA you may want to first test that the Selection is not a...
Read more >
Range object (Excel) | Microsoft Learn
Represents a cell, a row, a column, a selection of cells ... When it's used without an object qualifier (an object to the...
Read more >
Working with Cells and Ranges in Excel VBA (Select, Copy ...
Since it doesn't have cells/ranges in it, the above code can't select it and would end up showing an error. Note that since...
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