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

[EDIT] MonthView on Android: swipe behavior when the screen is Swiped #661

Closed
Shadufi opened this issue Oct 12, 2023 · 7 comments
Closed

Comments

@Shadufi
Copy link

Shadufi commented Oct 12, 2023

Hello
My problem is mainly on phone (Android) because on PC, it works perfectly.

There is a problem when I try to select a day on the MonthView. When I do this, it swipes to the right if I touch my screen on the right side, and vice versa for the left side.

Note: I've noticed that if I select the same date, it swipes me on the same date but one month before/after.

I've set true to lockSwipes to avoid this strange behavior, but it's preventing me from using the addon to its full potential.

Do you have a solution?

@twinssbc
Copy link
Owner

I'm not sure if I fully understand the behavior. Ideally it you select on a date, the current month view will be swiped to the month of that day. For example, if current month is October, if you select any date in October, the view should remain the same. If you select Nov 1st, it will navigate to November.
If you mean when you select a date, but the view goes to the previous/next month, then it's not correct. Do you have some logic that is changing current date when you select the date?

@Shadufi
Copy link
Author

Shadufi commented Oct 19, 2023

I'm not sure if I fully understand the behavior. Ideally it you select on a date, the current month view will be swiped to the month of that day. For example, if current month is October, if you select any date in October, the view should remain the same. If you select Nov 1st, it will navigate to November.
If you mean when you select a date, but the view goes to the previous/next month, then it's not correct. Do you have some logic that is changing current date when you select the date?

I don't understand why it's doing this either...
I can't select a day box unless I don't move my finger at all (which is rare). All it takes is an impulse
I have the impression that the sensitivity of the screen or the module when you touch a box causes it to change month. This only happens on my phone, because on the PC, the test phases go very smoothly.

The module is a copy-paste from the doc, I haven't added anything more.

I "corrected" the problem by blocking swipes, but it's not a real fix.

@Shadufi Shadufi changed the title MonthView on Android: swipe behavior when the screen is pressed [EDIT] MonthView on Android: swipe behavior when the screen is [pressed] Swiped Feb 5, 2024
@Shadufi
Copy link
Author

Shadufi commented Feb 5, 2024

Hi, I'm coming back to you with the same problem, I've figured out what's going on. When I swipe, it doesn't update the month I've just swiped.

(today = January) If I swipe right, it stays on January and doesn't update the view to February. If I swipe again, it updates to February (when I should be on the March slide) and when I touch the screen on my phone, it updates to the right month (in this case March because I swiped twice)

It works fine on Windows in the test phase, but not on Android.

I've max upgrade my dependencies :
"@angular:"17.0.9",
"@capacitor:"5.0.6",
"@ionic/angular": "7.7.0",
"ionic7-calendar": "2.3.0",
"swiper": "^11.0.0",
"tslib": "^2.6.1",

@Shadufi Shadufi changed the title [EDIT] MonthView on Android: swipe behavior when the screen is [pressed] Swiped [EDIT] MonthView on Android: swipe behavior when the screen is Swiped Feb 5, 2024
@Shadufi Shadufi closed this as completed Feb 7, 2024
@iPwa97
Copy link

iPwa97 commented Mar 8, 2024

Hi, I'm coming back to you with the same problem, I've figured out what's going on. When I swipe, it doesn't update the month I've just swiped.

(today = January) If I swipe right, it stays on January and doesn't update the view to February. If I swipe again, it updates to February (when I should be on the March slide) and when I touch the screen on my phone, it updates to the right month (in this case March because I swiped twice)

It works fine on Windows in the test phase, but not on Android.

I've max upgrade my dependencies : "@angular:"17.0.9", "@capacitor:"5.0.6", "@ionic/angular": "7.7.0", "ionic7-calendar": "2.3.0", "swiper": "^11.0.0", "tslib": "^2.6.1",

How do you fix it?

@vadyanB
Copy link

vadyanB commented Mar 28, 2024

@Shadufi Have the same issue. Are you finding a solution?

@Gautammer
Copy link

@Shadufi @iPwa97 I fixed it by adding
html:
<calendar (onCurrentDateChanged)="dateChanged($event)" [currentDate]="calendar.currentDate"> </calendar>

ts:
dateChanged(e){ this.calendar.currentDate = e; this.ref.detectChanges(); }

@DylanPrimera
Copy link

@Shadufi @iPwa97 I fixed it by adding html: <calendar (onCurrentDateChanged)="dateChanged($event)" [currentDate]="calendar.currentDate"> </calendar>

ts: dateChanged(e){ this.calendar.currentDate = e; this.ref.detectChanges(); }

thanks, this works for me!

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

No branches or pull requests

6 participants