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

feat: add IsHovered #116

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Not-Jayden
Copy link
Contributor

@Not-Jayden Not-Jayden commented Jul 8, 2024

Copy link

changeset-bot bot commented Jul 8, 2024

🦋 Changeset detected

Latest commit: 21e6e82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
runed Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jul 8, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
runed ✅ Ready (View Log) Visit Preview 21e6e82

@Not-Jayden Not-Jayden changed the title feat: add isHovered feat: add IsHovered Jul 8, 2024
@Not-Jayden Not-Jayden marked this pull request as ready for review July 8, 2024 12:22
@huntabyte
Copy link
Member

Thanks for kicking this off!

One thing I think we should handle before merging this is ensuring that emulated mouse events on mobile are ignored. One of the pain points of the :hover pseudo selector is with mobile devices.

@Not-Jayden
Copy link
Contributor Author

Thanks for kicking this off!

One thing I think we should handle before merging this is ensuring that emulated mouse events on mobile are ignored. One of the pain points of the :hover pseudo selector is with mobile devices.

@huntabyte Thanks. I've pushed a quick attempt at detecting hover capability, but based on your comment I'm thinking it's probably not your desired approach. Feel free to revert and/or change as desired if so, as I'm not super across the problem.

Self-review - if this is along the lines of what you had in mind, maybe any-hover and any-pointer would be a better choice to better cover edge cases of mixed inputs (e.g. phone with a mouse)

@huntabyte
Copy link
Member

Note to self - I've done something similar with https://github.com/svecosystem/svelte-interactions - specifically the createHover function. Perhaps we could bring that logic in here?

@Not-Jayden
Copy link
Contributor Author

Note to self - I've done something similar with svecosystem/svelte-interactions - specifically the createHover function. Perhaps we could bring that logic in here?

Oh, I had no idea that existed, nice! I actually prefer actions for this kind of stuff usually anyway, this just felt like a low hanging fruit while I was looking at the repo and comparing to other hook libraries.

I wonder if we can create a more generic adapter to rune-ify all those actions and re-use them rather than duplicating the logic in both places. Just comes with the consideration of whether it's worth making it a dependency 🤷‍♂️

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

Successfully merging this pull request may close these issues.

2 participants