drawio icon indicating copy to clipboard operation
drawio copied to clipboard

Freehand mode constantly changes cursor from mouse pointer to crosshairs

Open james-gour opened this issue 11 months ago • 15 comments

Preflight Checklist

  • [X] I agree to follow the Code of Conduct that this project adheres to.
  • [X] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug When using the freehand mode, as I write, the cursor constantly switches between a mouse cursor and a crosshairs cursor. The switch happens as the cursor is placed over the drawn text (if the left mouse button is not being held down). This is quite jarring/distracting as I try to write stuff down.

Expected behavior Unless, this is a feature I'm not aware of. I believe the expected behavior should be as simple as when freehand mode is activated, the cursor ALWAYS is a crosshair. This would be more aligned with other apps such as excalidraw where the cursor always stays the same.

I can make a small video if this doesn't make sense. Hopefully it is clear and I'm not missing the reason why this functionality exists :)

james-gour avatar Mar 06 '25 20:03 james-gour

@davidjgraph Anything I can do to help push this further? :)

james-gour avatar Mar 28 '25 22:03 james-gour

@davidjgraph Hey there :) This has been open for a long time, but should be a fairly easy fix! Would you mind providing an update? I feel like this will really help a lot of users for low effort!

james-gour avatar Oct 13 '25 15:10 james-gour

I haven't had time, could you post a PR for the fix please?

davidjgraph avatar Oct 13 '25 15:10 davidjgraph

I haven't had time, could you post a PR for the fix please?

Oh @davidjgraph thanks for you quick reply!! I didn't realize draw.io was open source / accepting PRs! Let me look into the fix and then post a PR :)

james-gour avatar Oct 13 '25 15:10 james-gour

Thanks, just no AI generation please, that's not permitted.

davidjgraph avatar Oct 13 '25 16:10 davidjgraph

Totally fair :) !!

james-gour avatar Oct 13 '25 16:10 james-gour

Hey @davidjgraph -> I found the issue, and PR - https://github.com/jgraph/drawio/pull/5297 - is up :)

It's just a simple 1-line change in js/diagramly/mxFreehand.js -> Theoretically you could leave the block below it, or you may want to just remove it, up to you.

Thanks for the help and the amazing product!!

james-gour avatar Oct 13 '25 19:10 james-gour

Testing this fix, I don't get the mouse cursor changing in the first place. What operating system and browser versions are you using?

alderg avatar Oct 14 '25 05:10 alderg

@alderg I'm on windows using draw.io desktop app. I also saw the issue in the browser draw.io on Edge. INTERESTINGLY, I did not see this issue when I ran draw.io electron app locally in Ubuntu.

I agree -> the mouse cursor should have never been normal after freehand mode was activated in the first place!

james-gour avatar Oct 14 '25 15:10 james-gour

@alderg Any luck?

james-gour avatar Oct 16 '25 18:10 james-gour

@alderg @davidjgraph Any progress on closing this? PR has been up for quite a bit, want to see if I can help in any way :)

james-gour avatar Oct 23 '25 16:10 james-gour

I can't repeat on Win 11 running 28.2.8 as desktop installer or on Edge.

We really need a reproduction case as the suggested PR looks somewhat wide in scope and we're concerned about side-effects. OS version, anything custom about mouse driver, accessibility settings, etc.

davidjgraph avatar Oct 24 '25 09:10 davidjgraph

@davidjgraph I'm running 28.2.8 Desktop version on Windows 11.

Here's a video https://streamable.com/3qt2i4

When I read that code, it reads like "only set the cursor to crosshair if you are mousing over a drawn object". To me it makes sense that the cursor is therefore not being set on an empty canvas as it should be.

I must be missing something here, obviously you guys live in this codebase all day, so let me know what I am missing!

I was thinking the proposed change should be minimal since I believe that outer code block is only scoped to freehand mode, but I'm sure there are parts of this I'm not considering. Regardless of how you implement, the logic should quite simply be: in freehand mode ALWAYS keep the cursor as a crosshair.

james-gour avatar Oct 24 '25 15:10 james-gour

We've implemented a fix which will be in the next release.

alderg avatar Oct 25 '25 05:10 alderg

Wonderful! Thank you very much for all the help!! :)

james-gour avatar Oct 27 '25 16:10 james-gour