deleteAtRange will consider a zero-length range on the first character
of a text node as a hanging selection, which is incorrect. This should
not be considered hanging.
It's still possible to hit the `startKey === endKey && isHanging`
conditional if endKey is in a void node, since we will bump the
selection to the previous node and update endKey (but then endOffset
is no longer 0, so it's not _really_ hanging anymore). We have an
existing test for that, and it still passes after this change.
When `block.texts()` is passed a path, it treats that path as relative
to itself. `findSelection` passes it the selection path, which is
relative to the document.
In order to find the correct text nodes, we must convert the selection
path to a path relative to the block we found. Then, when a new path
is returned, we need to convert that new block-relative path back to a
document-relative path.
* Working version of restore dom
* Fix linting errors
* Add button to corrupt DOM
* Added error boundary that fixes DOM on render error
* Fix linting errors
* Fix debug output for componentDidCatch
* Improve example by adding a separate restoreDOM button
* Remove key change from error boundary which is not necessary
* Fix linting error
* first stab at removing leaves with tests passing
* fixes
* add iterables to the element interface
* use iterables in more places
* update examples to use iterables
* update naming
* fix tests
* convert more key-based logic to paths
* add range support to iterables
* refactor many methods to use iterables, deprecate cruft
* clean up existing iterables
* more cleanup
* more cleaning
* fix word count example
* work
* split decoration and annotations
* update examples for `renderNode` useage
* deprecate old DOM-based helpers, update examples
* make formats first class, refactor leaf rendering
* fix examples, fix isAtomic checking
* deprecate leaf model
* convert Text and Leaf to functional components
* fix lint and tests
* Fix selection being reset incorrectly after combination of events
If mouseDown happens inside editor container and mouseUp outside it,
then programmatically calling editor.focus() after that will mess up
the selection
* Update after.js
* tests
* faster getSelectionIndeces by passing path during render
* rename var
* fix variables
* revert node component changes
* revert changes to content
* changes to element and path-utils
* fix point normalize
* cleanup
* more cleanup, clearer getDescendant
Looks like a worthwhile improvement to me @delijah and thanks for contributing the PR. Given that nested data structures are permissible this improved the ease of use.
* Allow the dev server to work for non localhost host
* Refactored set-selection-from-dom into utils as prep for Android support
* Show debug onInput at start if triggered
* Added and refactored to use set-text-from-dom-node with improved set selection after input
* Remove unnecessary console.log in set-text-from-dom-node
* Fixes to pass linter
* Adds basic composition to Android API27 including fixing one bug where compositionStart does not fire
* Fix some of the enter handling in API 27 and 28
* Add fixes for API 25
* Add debug for slate:update instead of separate render and updateSelection
* Add API 26 fix for ignoring all but Enter in onKeyDown
* Fix enter on Android 26 and 27
* Revert onSelect bug. Editor API 26 and 27 stable-ish
* Fix enter at beginning and end of word in API 26 and 27
* Fix enter handling at end of line API 26 and 27
* Fix reversion of enter bug when not at end of line
* Rename enter to linefeed which is more accurate
* Fix backspace on Android 27 and 28
* Fix enter at end of line then backspace then enter bug in API 26 and 27
* Refactor to simplify reading code
* Refactor to use executor and fix the suggestion problem
* Fix multi point edit in API 27/28
* Update Android documentation on enter handling
* Fix enter in API 26/27 and document 4 different enter cases
* Refactor partial into SlateSnapshot
* Complete SlateSnapshot refactor
* Remove unnecessary plugin comments
* Add smoke tests
* Rename smoke tests to composition in exmaples
* Fix API28 split join and insertion
* Fix space then backspace in middle of word bug in API 28
* Add text for middle word space and backspace bug
* Add note that the space backspace bug does not exist on API 27
* Fix 'It me. No.' bug in API 26/27
* Fix comments
* Update comments to fit Slate style guide
* Move a debug statement
* Fix zero-width selection placement bug.
* Fix 'it is' then enter in middle of 'it' bug
* Partial fix of enter, backspace, enter in word
* Add and fix comments. Fix selection in zero-width for API26-27
* Fix linting
* Fix documentation
* Remove snapback from packages
* Remove snapback from yarn.lock
* Rename SlateSnapshot to DomSnapshot
* Remove guard on DomSnapshot apply method
* Remove debug plugin from plugins/dom
* Remove unnecessary comment in content.js componentDidUpdate
* Remove closest and add function into dom-snapshot directly
* Remove unused DebugPlugin
* Move Android detection related code into slate-dev-environment
* Capitalize to Number in JSDoc
* Add API version and Input Events Level 2 for Android
* Add input events level 2 for android without matching api version
* Fix line failures