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

Add touch / swipe away support #37

Open
oneezy opened this issue Feb 5, 2022 · 4 comments
Open

Add touch / swipe away support #37

oneezy opened this issue Feb 5, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@oneezy
Copy link

oneezy commented Feb 5, 2022

Would be a nice to feature to be able to "Swipe" the toast message away (left or right) and also make the toast "stay" on mousedown or when holding down with your finger

@zerodevx
Copy link
Owner

zerodevx commented Feb 6, 2022

Hey, thanks for your comment. On first pass I think the swipe gesture should be easy to implement, but I think there'll be many edge cases to think about, eg. what happens when a new toast is pushed during a swipe etc.

Might take a stab at this soon - marking this as a feature request in the meantime.

@zerodevx zerodevx added the enhancement New feature or request label Feb 6, 2022
@oneezy
Copy link
Author

oneezy commented Feb 6, 2022

ah yeah good point. i wonder how other apps might handle this?

one idea that comes to mind could be to pause new toast notifications from being pushed on mousedown or touch and then resume after

@evankford
Copy link

A pause/throttle loop would be generally a good idea.

That said, I think there's another good way, which would be to store the target of the swipe gesture and/or the length of the current toasts at the beginning of the gesture. Then, if you pop/push in a new toast, you can just cancel the swipe or alternatively dismiss the initial target (maybe depending on a sensitivity or something like that?)

@oneezy
Copy link
Author

oneezy commented Mar 24, 2022

yeah definitely! i like the sound of it

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

No branches or pull requests

3 participants