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

hoverCursor on selectable:false #1392

Closed
Tilogorn opened this issue Jun 13, 2014 · 17 comments
Closed

hoverCursor on selectable:false #1392

Tilogorn opened this issue Jun 13, 2014 · 17 comments

Comments

@Tilogorn
Copy link

When setting 'selectable:false' to an object, the property hoverCursor doesn't have anymore influence. Is that intended? Mouseover-Events are still fired. Seems illogical for me (in most cases, you won't need a hoverCursor on non-selectable elements, but at least you could have the choice).

http://jsfiddle.net/4qcAL/

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kangax
Copy link
Member

kangax commented Jun 14, 2014

This is as intended. If an object is unselectable, what's the point of showing cursor if you can't select it?

@Tilogorn
Copy link
Author

For UI-Elements, like simple Buttons:
http://jsfiddle.net/h8vkK/3/
Button 1 has the behaviour "simulated" with two extra props set, Button 2 has the behaviour as wished, just the cursor can't be influenced.

@Dawied
Copy link

Dawied commented Nov 27, 2014

I Agree. I also made buttons that should not be selectable but still show a pointer cursor.

@wriahi
Copy link

wriahi commented May 8, 2015

I have selectable = false and objets should link to another page, so I need to set hoverCursor = pointer on a mouseover event.
Is there a way around this?

@cmnt
Copy link

cmnt commented Jan 18, 2016

I Agree. I also made buttons !

@asturur
Copy link
Member

asturur commented Apr 30, 2016

yes non selectable but clickable events should be considered as an option

@jamescram
Copy link

It looks like this was reverted without any discussion in issue #3634. I have the same reason for needing this feature as other commenters on this issue - namely creating "buttons" on a fabric.js canvas that should show a pointer icon on hover, but should not be selectable/editable.

Perhaps this should be made an option, since it seems both behaviours are desirable in different circumstances?

@asturur
Copy link
Member

asturur commented May 9, 2017

i think there is a way to change cursor on hover with selectable false. let me check.

@maxhudson
Copy link

maxhudson commented May 15, 2017

@asturur I'm seeing this as well - it does not work in this example:

fabricObject.set({
  selectable: false,
  hoverCursor: 'pointer'
});

Setting selectable: true makes hover work again.

@tscislo-lingaro
Copy link

Same for me. Only setting selectable to true, which is not what I need allows me to change the cursor type...

@tscislo-lingaro
Copy link

There is a workaround to have a cursor pointer and not interactive element with those props:

       selectable: true,
        lockMovementY: true,
        lockMovementX: true,
        hasBorders: false,
        hasControls: false,
        hoverCursor: 'pointer',

@mt404
Copy link

mt404 commented Oct 16, 2019

Seems a bit presumptuous to dictate what cursors people can can't use in certain situations.

No Cursor for you!

With great power comes great responsibility. yada yada. Let us choose to make bad design choices if we want to. You're not the boss of my cursor. I am.

@asturur
Copy link
Member

asturur commented Dec 3, 2019

@mt404 i m not sure what was the message you wanted to give to us.

I may have done bad decisions building features for fabricJS. This issues is from 2017 and i m not sure what is the current situation.

The whole controls/cursors are under rewriting with a more permissive model

@codingenvy
Copy link

As a follow-up to tscislo-lingaro's excellent solution: if you would like to have the default hoverCursor back just set hoverCursor: '' (i.e. empty string)

@whatisor
Copy link

whatisor commented Jan 17, 2022

Hi,
This is a bad suggestion. Because it keeps searching non-selectable object while mouse moving.
Such as we have grid objects, it is bad performance.

@asturur
Copy link
Member

asturur commented Jan 18, 2022

The objects needs either to be skipped or not skipped, won't change that much.
You can set them as evented: false if you want to skip them entirely

@whatisor
Copy link

Yeah, I found that option while finding solution, it works well.

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

No branches or pull requests