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

[Tooltip] Ability to follow cursor position #1178

Closed
jjenzz opened this issue Feb 23, 2022 Discussed in #1090 · 16 comments
Closed

[Tooltip] Ability to follow cursor position #1178

jjenzz opened this issue Feb 23, 2022 Discussed in #1090 · 16 comments
Labels
Resolution: Won't Fix This issue will not be fixed

Comments

@jjenzz
Copy link
Contributor

jjenzz commented Feb 23, 2022

I'm not entirely sure if tooltip would be the correct a11y pattern for this but we can investigate that if team thinks this is worth supporting.

Discussed in #1090

Originally posted by Rednegniw January 16, 2022
Hi, first, amazing library! So thank you very much for developing it.

Just had an idea - it would be cool if there was a component such as a tooltip that would follow the mouse/cursor position while hovering over an element. It might interesting, for example, when you want to tell the user why they can't click on a disabled element and so on.

Something like this - https://codepen.io/paulvddool/pen/mROEGa (not mine, found randomly on google)

@benoitgrelard benoitgrelard added the Resolution: Won't Fix This issue will not be fixed label Apr 5, 2022
@benoitgrelard
Copy link
Collaborator

We probably won't do this anytime soon, so closing for now.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 11, 2022

why are feature requests being closed? i don't understand the harm in them remaining otherwise wouldn't it just deter people from providing valuable suggestions?

@benoitgrelard
Copy link
Collaborator

Thanks for raising this @jjenzz.

We looked into it a bit further and it looks like it isn't something we would consider for Radix given that it would go against an accessibility criterion which are actively working towards: #620.

So rather than "not doing this anytime soon", we can clarify to say this isn't something we would consider as it breaks accessibility.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

that makes sense in terms of tooltip, i wonder if this could be a different component though? like the multiplayer mode cursors seen here https://www.framer.com/

@benoitgrelard
Copy link
Collaborator

Given that criteria, I don't think this is possible as an accessible component, given that it shows on hover, that criteria would then be impossible to fulfill.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

The a11y in my mind might be to aria-hidden it, similar to how HoverCard is for sighted users only. I just think it would be nice to explore the a11y of these types of cursors as it is a common pattern these days. Not a priority ofc, but a nice idea.

@benoitgrelard
Copy link
Collaborator

Is it really a common pattern? I don't think I have ever seen this in the wild.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

i've seen it quite a bit recently. vercel did it on their conference marketing website, figma do it for multiplayer, looks like framer do too. liveblocks provide apis for live cursor support too.

@benoitgrelard
Copy link
Collaborator

Right, I guess that's a completely different pattern, more like these "live cursor" things rather than a tooltip, so not really linked to a trigger area either. It's not even really something that follows your own cursor really, it's more that you have the representation of a fake cursor with a bubble attached to it.

I'm not sure this fits well within Radix personally, but if you think there's some value Radix could provide there, feel free to submit a new primitive request.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

yes that's what i meant by "multiplayer cursors" and is the reason why i said in the original ticket description that i am not convinced tooltip is the right pattern for this 🙂

happy to rename this ticket if it's clearer. i think it is worth exploring for the same reasons we provide a HoverCard but i have no idea how radix would do it 😅

i raised the ticket to explore someone else's request in discussions is all. a component that follows cursor could be used for "multiplayer cursors" or additional context that isn't important for SRs.

@benoitgrelard
Copy link
Collaborator

Personally I feel like this is VERY niche when compared to a pattern like HoverCard, and so probably better handled by more dedicated solutions like LiveBlocks (who incidentally also use Radix 😀).

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

I don't think liveblocks provide the components, just the websockets stuff. but yeah, it's not as common as HoverCard for sure. So is radix stance to close any requests that might be becoming popular but not currently common enough?

I agree it might not be possible at all with the radix uncontrolled compound component pattern, but seemed worth exploring someday to see (there is ContextMenu that is tied to cursor position after all). Happy to close if you don't think Radix would ever consider it though.

@benoitgrelard
Copy link
Collaborator

So is radix stance to close any requests that might be becoming popular but not currently common enough?

No, not at all! The original request was for this feature to be added to Tooltip which isn't valid because of accessibility reasons.

But like I said here 👇, this is something we can add as a new primitive request although it would be good if we can formulate a bit better what the component actually is.

I'm not sure this fits well within Radix personally, but if you think there's some value Radix could provide there, feel free to submit a new primitive request.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

The original request was for this feature to be added to Tooltip which isn't valid because of accessibility reasons.

When I raised the ticket with "I'm not entirely sure if tooltip would be the correct a11y pattern for this" I meant that I liked the idea but perhaps tooltip isn't the right component for this. I'll rename the ticket to make this all clearer and leave it to the team to formulate the spec.

@benoitgrelard
Copy link
Collaborator

If we're going to add a new primitive request for this, I'd rather a different ticket I think as it keeps things clearer and separated. Given the original discussion was clearly about adding this to Tooltip.

@jjenzz
Copy link
Contributor Author

jjenzz commented Apr 12, 2022

Yeah sure, if that helps avoid confusion i can do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Won't Fix This issue will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants