If I select a block the test in editor by double click the end key is first character of next block.
Can you provide a video or GIF? I'm not able to repro this.
Hi @hellendag,
Please find the gif (here size of selected blocks is number of blocks selected):

this is definitely a very common user behavior and a real issue
Hi! I'm also running into this issue (double clicking a block can lead to the end key overlapping into the next block).
I'm currently handling it by doing an extra check:
const selection = editorState.getSelection();
const startKey = selection.getStartKey();
const endKey = selection.getEndKey();
const selectionEnd = selection.getEndOffset();
const nextKey = editorState.getCurrentContent().getKeyAfter(startKey);
if (startKey === endKey || (selectionEnd === 0 && endKey === nextKey)) {
// The user only meant to select one block
}
Checking in 2 years after this was first posted: any resolutions here?
(I don't have the same exact issue, but double clicking on text inside a block to select the whole text is giving incorrect offsets - they are based on where the double click started)
(Update: the above behavior is on triple-click actually)
Note that this works fine in Firefox, so it looks like a WebKit-specific issue.
Seeing this issue as well, but with a triple click to select everything in the current block. The selectionState focusOffset is set to the next block, at 0
Most helpful comment
Hi @hellendag,
Please find the gif (here
size of selected blocksis number of blocks selected):