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

[Bug]: lockScalingX affects cursor of Textbox width control #9042

Open
7 tasks done
thorstenv opened this issue Jun 21, 2023 · 4 comments
Open
7 tasks done

[Bug]: lockScalingX affects cursor of Textbox width control #9042

thorstenv opened this issue Jun 21, 2023 · 4 comments

Comments

@thorstenv
Copy link

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

5.3.0

In What environments are you experiencing the problem?

No response

Node Version (if applicable)

None

Link To Reproduction

https://codesandbox.io/p/sandbox/fabric-nextjs-sandbox-forked-kx77wj

Steps To Reproduce

  1. Add new Textbox
  2. Lock ScalingX
  3. When hovering the ml or mr controls, the UI thinks it is locked, but width of textbox can still be modified

works in kitchensink too

Expected Behavior

Width of textbox cannot be changed.

Preferably prevent changeWidth.ts from modifying width when scalingX is locked (if not possible or not wanted, maybe not show the forbidden sign on hovering)

Actual Behavior

Width of textbox can be changed although ui shows the forbidden sign

Error Message & Stack Trace

No response

@ShaMan123
Copy link
Member

ShaMan123 commented Jun 21, 2023

When hovering the ml or mr controls, the UI thinks it is locked, but width of textbox can still be modified

You said it! The width, not the scale. 2 different things.
I would recommend using

shouldActivate(controlKey: string, fabricObject: InteractiveFabricObject) {
instead of the lockXXX flags

I see what you are referring to, the truth is the cursor is affected by lockScaling flag but it should NOT.

@ShaMan123 ShaMan123 changed the title [Bug]: lockScalingX does not work on Textbox [Bug]: lockScalingX affects Textbox change width control cursor Jun 21, 2023
@ShaMan123
Copy link
Member

If you are up for PRing I can help you

@ShaMan123 ShaMan123 changed the title [Bug]: lockScalingX affects Textbox change width control cursor [Bug]: lockScalingX affects cirsor of Textbox width control Jun 21, 2023
@ShaMan123 ShaMan123 changed the title [Bug]: lockScalingX affects cirsor of Textbox width control [Bug]: lockScalingX affects cursor of Textbox width control Jun 21, 2023
@thorstenv
Copy link
Author

Maybe i'm missing something, but in the code shouldActivate is only called one time, and the function there is about corner controls. Looks to me like shouldActivate on mr or ml is not even being used

@asturur
Copy link
Member

asturur commented Sep 2, 2023

there are 2 parts here:
1 stop having cursor being affected
2 create a control that can be locked at will. to understand better 2, you could tell us more on when you would lock textbox resizing and why/how.

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

3 participants