1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-25 01:33:37 +01:00
Jason Staten 4d0ccc8e81 Fix Edge positioning with newlines (#2622)
* Fix Edge positioning with newlines

Edge has a [bug][1] where `Range.prototype.toString()` will convert `\n`
into `\r\n`. The bug causes a loop when slate-react attempts to
reposition its cursor to match the native position.

This change avoids calling `Range.prototype.toString()` by cloning the
content nodes and measuring `textContent` on those instead.

[1]: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10291116/

* Add COMPAT message
2019-03-07 18:01:59 -05:00
..

This package contains the React-specific logic for Slate. It's separated further into a series of directories:

  • Components — containing the React components for rendering Slate editors.
  • Constants — containing a few private constants modules.
  • Plugins — containing the React-specific plugins for Slate editors.
  • Utils — containing a few private convenience modules.

Feel free to poke around in each of them to learn more!