Fabric.js: Selecting a word with double click also selects one leading newline character

Created on 6 Sep 2019  路  2Comments  路  Source: fabricjs/fabric.js

Version

2.7.0

Test Case

http://jsfiddle.net/79ubyp1a/

Information about environment

All it seems

Steps to reproduce

Create a texbox and enter two words with a newline character in between so second word ends up on a new row. Now select the second word by double clicking that word (and remove it to see the effect of this).

Expected Behavior

Only the word is selected so that the cursor stays on the second row when removed.

Actual Behavior

The word (including the newline char) is selected which puts the cursor is back on the top row when removing/replacing what's selected.

(This does not happen if you click and drag to select the second word)

bug itext

Most helpful comment

@asturur I work on the same project as Tsourdox and i can reproduce the problem in the fiddle by just doubleclicking on the last word. It is more obvious if you put a blank line in between the two words.
Double click on last lines word gives this marking
image

Have reproduced it also in our own product thats using FabricJS 3.4.0
When this bugg was created here in Github we were running 2.7.0

All 2 comments

Hi @Tsourdox the fiddle posted works correctly in chrome.
You open the issue quoting version 2.7.0 but the fiddle is build on latest master ( 3.4.0 ).
Is that a typo? are you referring to 2.7.0 or 3.4.0?

@asturur I work on the same project as Tsourdox and i can reproduce the problem in the fiddle by just doubleclicking on the last word. It is more obvious if you put a blank line in between the two words.
Double click on last lines word gives this marking
image

Have reproduced it also in our own product thats using FabricJS 3.4.0
When this bugg was created here in Github we were running 2.7.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lyzs90 picture lyzs90  路  3Comments

guettli picture guettli  路  4Comments

eddieyangtx picture eddieyangtx  路  5Comments

keanass picture keanass  路  5Comments

vleandersson picture vleandersson  路  4Comments