ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.65k stars 3.23k forks source link

Firefox. Editor.marks incorrectly identifies active marks #4298

Open ugrinovsky opened 3 years ago

ugrinovsky commented 3 years ago

Description If you place the cursor after a marked word (for example, bold) and start highlighting adjacent words, the active mark will be bold.

If you show active marks in the toolbar, it will be an error.

Recording Actual: https://user-images.githubusercontent.com/8024592/119876987-292c3d80-bf31-11eb-9132-d3babb6e4ab0.mp4

Expected (Google Chrome): https://user-images.githubusercontent.com/8024592/119876975-25002000-bf31-11eb-84d1-d27c814d8928.mp4

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

Steps To reproduce the behavior:

  1. Place cursor at the end of a bold word;
  2. Start highlighting adjacent words with a hotkey Ctrl + Shift + →;
  3. Look into the console.

Expectation Behavior like Google Chrome is expected. The array of marks must be empty.

Environment Slate Version: 0.63.0. Operating System: all. Browser: Firefox 87.0 (64-bit).

YaoKaiLun commented 3 years ago

I got the same issue, when selecting bold texts and normal text, Editor.marks returns { bold: true }

image