Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carriage return with space are inserted instead of space for inline text editing in Google Crome v57 #3798

Closed
pavloKozlov opened this issue Mar 23, 2017 · 11 comments

Comments

@pavloKozlov
Copy link

This bug can be reproduced only with Google Chrome version 57.
I did some investigation and looks like this bug appears for any fabricjs version starting from 1.6.0.

Version

fabricjs >= 1.6.0
Google Chrome 57

Test Case

works ok: https://jsfiddle.net/28sdvzoz/ with fabric 1.5.0
bug reproduces: https://jsfiddle.net/ttbsfgxt/ with fabric 1.6.0 and higher

Steps to reproduce

  1. set cursor anywhere in text but first and last position (e.g. in "Some text" string, set cursor after "m" character)
  2. press and release space key

Expected Behavior

Space is inserted and text becomes
"Som e text"

Actual Behavior

Carriege return with space are inserted and text becomes
"Som
e text"

@asturur
Copy link
Member

asturur commented Mar 23, 2017

is a chrome bug.
https://bugs.chromium.org/p/chromium/issues/detail?id=702926

would be nice to contribute to bug confirmation there after trying the fiddle i left.

Also there is a workaround in a branch called newtext here in the initHiddenTextarea function. grab the style for the textarea from that function. i will hotfix in 1.7.9 as soon as i have some time.

@onassar
Copy link

onassar commented Mar 23, 2017

@asturur which commit in newtext branch addresses this Chrome bug?

@asturur
Copy link
Member

asturur commented Mar 23, 2017

i committed lot of stuff all togheter.
check the function initHiddenTextarea and pick up updated style for textarea

@onassar
Copy link

onassar commented Mar 23, 2017

Can you point me to the file where I can view the code?

@asturur
Copy link
Member

asturur commented Mar 23, 2017

image

@pavloKozlov
Copy link
Author

Changing width and height of hidden textarea from 0 to1 pix fixed the issue. Thanks, @asturur.

@onassar
Copy link

onassar commented Mar 23, 2017

Thanks. Are you saying that the style cssText property having the value that it does fixes this Chrome bug?

@asturur
Copy link
Member

asturur commented Mar 23, 2017

you have also to use whitespace nowrap. changing width and height will just move the problem to more space pressed

@onassar
Copy link

onassar commented Mar 23, 2017

Great thanks that fixed it for now. Hope Chrome fixes it soon as well

@rajdeeptayde
Copy link

Changing width and height of hidden textarea from 0 to1 pix fixed the issue. Thanks, @asturur.

can you please specify your code I am getting th same issue ut i dont know how t solve it

@asturur
Copy link
Member

asturur commented Feb 6, 2020

this fix was inserted in the main library, you should not need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants