ngx-gallery icon indicating copy to clipboard operation
ngx-gallery copied to clipboard

Replace hammerJS with native touch events

Open vpetrusevici opened this issue 2 years ago • 9 comments

Currently I implemented swiping only for touch events (not mouse) and only for gallery-swiper component (not thumbs). MurhafSousli Can you check please if my implementation is good enough and I can continue work in this way? For #449

vpetrusevici avatar Aug 09 '22 22:08 vpetrusevici

@MurhafSousli strange about swiping. I just retested it in chrome. Looks like is working https://amdaris-my.sharepoint.com/:v:/p/vladimir_petrusevici/EShrbtcG6pFDng1Z2TeSJQ8BzEmBGQIiCwkzAaM7tEAXzg?e=UBLKuq

vpetrusevici avatar Aug 10 '22 06:08 vpetrusevici

Also I see a problem with autoplay. Application will never have a stable state when autoPlay = true in the current implementation. You can check it in this way image

I think this observable with delay should be also moved outside ngZone.

vpetrusevici avatar Aug 10 '22 07:08 vpetrusevici

Also I see a problem with autoplay. Application will never have a stable state when autoPlay = true in the current implementation. You can check it in this way image

I think this observable with delay should be also moved outside ngZone.

Fixed with custom async pipe. Now the app is always stable.

vpetrusevici avatar Aug 10 '22 12:08 vpetrusevici

Implemented mouse events

vpetrusevici avatar Aug 10 '22 16:08 vpetrusevici

Aaaand looks like all functionalities are implemented now.

vpetrusevici avatar Aug 10 '22 19:08 vpetrusevici

@MurhafSousli should i change the docs or is it better to leave it to you?

vpetrusevici avatar Aug 10 '22 19:08 vpetrusevici

I should stop pushing... sorry)

vpetrusevici avatar Aug 12 '22 23:08 vpetrusevici

@MurhafSousli Hi, I fixed the conflicts. Can you check this PR please?

vpetrusevici avatar Sep 05 '22 12:09 vpetrusevici

Hi @MurhafSousli, did you have a chance to check it out? Сan't wait to finish this PR :)

vpetrusevici avatar Sep 20 '22 09:09 vpetrusevici

Hi @MurhafSousli, did you have a chance to check it out? Сan't wait to finish this PR :)

When you add many unnecessary changes, you make it difficult for me to review! please keep the PR focused next time and don't refactor parts that are not related to the replacement of hammer.js

MurhafSousli avatar Oct 02 '22 17:10 MurhafSousli

Hi @MurhafSousli, did you have a chance to check it out? Сan't wait to finish this PR :)

When you add many unnecessary changes, you make it difficult for me to review! please keep the PR focused next time and don't refactor parts that are not related to the replacement of hammer.js

Sorry, i can try to recreate the PR with only necessary changes, but don't think it will be much smaller

vpetrusevici avatar Oct 02 '22 18:10 vpetrusevici

I think HammerJS is not bad, comparing the benefits we would get from implementing our own touch-events solution does not bring any value in terms of feature or functionality, we are just adding more code which we will have to maintenance, in favor of getting rid of one dependency.

I will close this for now, but will keep an eye on your solution if something changed.

Thanks for the PR anyway!

MurhafSousli avatar Oct 05 '22 20:10 MurhafSousli