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

Close Hint On Element Click #45

Open
mpigsley opened this issue Aug 20, 2019 · 5 comments
Open

Close Hint On Element Click #45

mpigsley opened this issue Aug 20, 2019 · 5 comments

Comments

@mpigsley
Copy link

mpigsley commented Aug 20, 2019

If only the "click" event is set to true, it seems as though clicking an element with data-rh works to open the hint but clicking it again does not close the hint.

I can wire up toggleHint from the ref, but it seems like the default here should be to close hint if the element is clicked again. If persist is set to true then it shouldn't close on click. At least that's how I interpret it.

@mpigsley mpigsley changed the title Close On Button Click Close Hint On Element Click Aug 20, 2019
@slmgc
Copy link
Owner

slmgc commented Aug 21, 2019

Hi, thanks for raising this issue. Indeed, currently, it doesn't hide the hint in case of triggering the same event. Initially, the API was made for hover events, click events were kinda ad-hoc, that's why they aren't convenient to deal with. The persist property was introduced to retain the hint if you hover/click inside of the hint itself, otherwise, it would become hidden.

You are right, it makes sense to hide the hint on click if it's already shown, but this change breaks compatibility and might affect someone else's code and I would like to avoid it. As you've mentioned the only suitable way, for now, is to use toggleHint as described here: #32 (comment).

I am working on the next API, it's halfway there, but I would like to get as much feedback as possible about all the inconveniences with the current API and have a proper discussion around the new API. If you could join the discussion it would be awesome: #46

@mpigsley
Copy link
Author

Absolutely! Thanks for comment @slmgc!

@tonypee
Copy link

tonypee commented Mar 1, 2021

Is a v4 happening, which this would be a part of?

@slmgc
Copy link
Owner

slmgc commented Apr 2, 2021

@tonypee it is happening, I would like to close this deal within April

@tonypee
Copy link

tonypee commented Apr 6, 2021

@slmgc Great! Hope to get to play with it soon!

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