mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(datetime): disable intersection observer during month update (#24713)
Resolves #24712
This commit is contained in:
@ -771,6 +771,13 @@ export class Datetime implements ComponentInterface {
|
|||||||
*/
|
*/
|
||||||
writeTask(() => {
|
writeTask(() => {
|
||||||
|
|
||||||
|
// Disconnect all active intersection observers
|
||||||
|
// to avoid a re-render causing a duplicate event.
|
||||||
|
if (this.destroyCalendarIO) {
|
||||||
|
this.destroyCalendarIO();
|
||||||
|
}
|
||||||
|
|
||||||
|
raf(() => {
|
||||||
this.setWorkingParts({
|
this.setWorkingParts({
|
||||||
...this.workingParts,
|
...this.workingParts,
|
||||||
month,
|
month,
|
||||||
@ -778,10 +785,12 @@ export class Datetime implements ComponentInterface {
|
|||||||
year
|
year
|
||||||
});
|
});
|
||||||
|
|
||||||
raf(() => {
|
|
||||||
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
|
||||||
calendarBodyRef.style.removeProperty('overflow');
|
calendarBodyRef.style.removeProperty('overflow');
|
||||||
calendarBodyRef.style.removeProperty('pointer-events');
|
calendarBodyRef.style.removeProperty('pointer-events');
|
||||||
|
|
||||||
|
endIO?.observe(endMonth);
|
||||||
|
startIO?.observe(startMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user