ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)

Home Page:http://slatejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistent Firefox selection with rowspan in td element

nlulic opened this issue · comments

Description
I've been working on a table plugin for Slate that is intended to support colspan and rowspan attributes. I've observed an inconsistency in the selection API on Firefox when a td with a rowspan attribute is included in the selection.

This leads to incorrect cells being designated as anchor and focus nodes, as seen in the GIF below.

Recording
ff-table-selection
Green: anchor
Light green: focus

Sandbox
https://stackblitz.com/edit/stackblitz-starters-zbtxfm?file=src%2FApp.tsx

Steps
To reproduce the behavior:

  1. Open the Stackblitz example in Firefox.
  2. Select a range from a td below the cell with a rowspan (e.g., 5) to the cell with the rowspan attribute (cell 3).
  3. the anchor and focus nodes do not match to the start and end of your range selection.

Expectation
In Firefox, the selection behavior should align with that of Chrome, appointing the start and end nodes as the anchor and focus nodes.

Environment

  • slate: 0.100.0
  • slate-react: 0.100.1
  • Operating System: Fedora Linux 38 (Workstation Edition)
  • Browser: Firefox