-
-
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
fix(IText): support control interaction in text editing mode #8995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very simple and gets the job done!
Build Stats
|
@@ -404,6 +404,10 @@ export abstract class ITextBehavior< | |||
* called by {@link canvas#textEditingManager} | |||
*/ | |||
updateSelectionOnMouseMove(e: TPointerEvent) { | |||
if (this.__corner) { | |||
return; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i kind of understand the need of this particular return, but it would be nice if you can add an approximate picture of how your control look like, even a fake one without having to disclose work things, and explain which interaction you make possible that interacts with the mouse move of the selection.
It seems good and safe to me. |
done |
ok now i undertstand. I thought it was some more custom stuff |
Motivation
I want to leave text transformable while being edited.
Overriding
_setEditingProps
and removing the part that remove controls when enter editing, gives me a transformable text object, but the selection event handler run togheter with the trasnform when i use the controls.This exposes the need to disable cursor/selection logic while interacting with a control.
This is seems possible with two simple changes on the handlers.
Needed for work.
Description
I am not adding tests because this requires an interaction test.
Changes
Gist
In Action
Enter text editing and then use the controls to resize the text object
https://codesandbox.io/p/sandbox/fabric-nextjs-sandbox-forked-d9r99p?file=%2Fpages%2Findex.tsx%3A13%2C18
fabric.js.sandbox.-.Google.Chrome.2023-06-07.21-31-52_Trim.mp4