-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Other <input> elements lose focus whenever there is a mouseout on the canvas while in text edit mode #8177
Comments
good catch |
I don't agree with the solution in the PR |
This is more or less what I did |
Wont that solution still take the focus out of the text input if you happen to move the mouse over the canvas at all? |
focusing will trigger only if in editing mode and after mousedown Originally posted by @ShaMan123 in #8179 (comment) |
fixes fabricjs#8177 caused by fabricjs#3759 and fixes fabricjs#3661 that was the motivation for fabricjs#3759 This issue was caused because the hiddenTextarea looses focus after mousedown. So I have added a focus call in mousemove that fixes both issues.
Version
5.2.1
https://jsfiddle.net/6hmuzak0/1/
Information about environment
Any browser
Steps To Reproduce
Expected Behavior
The new character should go into the text input
Actual Behavior
The new character goes into the i-text
Notes
Looks like the code to refocus was added because of #3661
Essentially, the code added makes up for the lack of a click event if you start your click inside of the canvas but finish your click outside of the canvas. The click event is what fabric relies on to focus back into the hidden text area. The focus is lost while the mouse is down because to the browser that is effectively a mousedown event outside of the hidden text area. This manifests itself in things like not being able to type/delete while you are dragging the mouse to change the selection in a text area.
Some ideas I for possible solutions:
Thanks!
The text was updated successfully, but these errors were encountered: