- From: abhish-shrivastava <notifications@github.com>
- Date: Sun, 06 Oct 2024 23:26:57 -0700
- To: w3c/selection-api <selection-api@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 7 October 2024 06:27:01 UTC
The selection.isCollapsed works by detecting start and end nodes and their offsets. This sometimes leads to inconsistencies because of different implementations by different browsers (especially on mobiles, tested this on chrome). Here is what happens- 1. When a cursor is placed at the beginning of a list, the selection.isCollapsed should ideally return true and selection.type as 'cursor'. 2. However, if there is text (say a paragraph block previously to the list), then it still gives false because startContainer is then taken as the previous text block (while end container points correctly to the list item, li of the list). So even though nothing is selected and it is just a cursor, selection.isCollapsed returns false and selection.type as 'range'. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/selection-api/issues/337 You are receiving this because you are subscribed to this thread. Message ID: <w3c/selection-api/issues/337@github.com>
Received on Monday, 7 October 2024 06:27:01 UTC