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

Replace hammerjs with native touch events #449

Open
vpetrusevici opened this issue Aug 3, 2022 · 16 comments
Open

Replace hammerjs with native touch events #449

vpetrusevici opened this issue Aug 3, 2022 · 16 comments

Comments

@vpetrusevici
Copy link
Contributor

What is the expected behavior?

Use native pointermove event instead of outdated hammerjs.

What is the current behavior?

We should install and use hammerjs to enable touch events.

What is the use-case or motivation for changing an existing behavior?

Possibility to avoid additional dependency.

Is there anything else we should know?

I can try to implement it if you agree.

@vpetrusevici
Copy link
Contributor Author

It also can be just another tree-shacking library like this one https://github.com/nolimits4web/swiper

@MurhafSousli
Copy link
Owner

Yes, you can try, PRs are welcome!

@vpetrusevici
Copy link
Contributor Author

Added a draft PR as PoW

@MurhafSousli
Copy link
Owner

MurhafSousli commented Aug 10, 2022

@vpetrusevici Thanks, I will have a look!

@vpetrusevici
Copy link
Contributor Author

@MurhafSousli I finished all related work. Hope I didn't miss any features

@vpetrusevici
Copy link
Contributor Author

Hi, @MurhafSousli
Sorry to bother you, but could you please check my PR?

@MurhafSousli
Copy link
Owner

@vpetrusevici an update on this issue... version 8 removed the usage of HammerJs for mobile sliding! it does not use the native touch events either! it is now using the native scrolling to slide the gallery!

However, HammerJs is still used BUT only for sliding on desktop browser using the mouse.

Feedback is appreciated https://github.com/MurhafSousli/ngx-gallery/releases/tag/v8.0.0-beta.1

@vpetrusevici
Copy link
Contributor Author

Thank you! I'll test it :)

@vpetrusevici
Copy link
Contributor Author

Hi! I notice some update promlem in gallery thumbs https://1drv.ms/u/s!ArDpOrDSusKbvyki94glg5pxuZNB?e=h3S3aK

@MurhafSousli
Copy link
Owner

Should be fixed in v8.0.0-beta3

@vpetrusevici
Copy link
Contributor Author

vpetrusevici commented Oct 29, 2022

It's working well in a lightbox, but in a simple gallery the problem still exists. I think the problem in the async pipe. You can try to use this variant https://github.com/MurhafSousli/ngx-gallery/pull/483/files#diff-b9348fa0028b29ce8458b889a0dbfa72d9b766f99e4666c57e9392a5de5c7012 It should subscribe outside of ngZone and execute changes in ngZone

@MurhafSousli
Copy link
Owner

The problem is with the gallery size, if the gallery's width value has fraction e.g. 500.63px, then it will have this issue, but with the latest fix, I forced the gallery to have a fixed size value

@vpetrusevici
Copy link
Contributor Author

I tried with beta4. The same behaviour

@vpetrusevici
Copy link
Contributor Author

Tested on mobile. Here looks good

@MurhafSousli
Copy link
Owner

Can you test it with beta5?

@vpetrusevici
Copy link
Contributor Author

I tested in chrome and android. Looks good. Only 1 bug found for SSR #532

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

2 participants