mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
fix(refresher): set overflow styles when using custom scroll target (#27058)
* bug(refresher): set overflow styles when using custom scroll target * bug(refresher): set overflow styles when using custom scroll target * Apply suggestions from code review Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com> * Add comment --------- Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
This commit is contained in:
@ -354,7 +354,10 @@ export class Refresher implements ComponentInterface {
|
||||
|
||||
this.state = RefresherState.Pulling;
|
||||
|
||||
writeTask(() => this.scrollEl!.style.setProperty('--overflow', 'hidden'));
|
||||
// When ion-refresher is being used with a custom scroll target, the overflow styles need to be applied directly instead of via a css variable
|
||||
const { scrollEl } = this;
|
||||
const overflowProperty = scrollEl!.matches(ION_CONTENT_CLASS_SELECTOR) ? 'overflow' : '--overflow';
|
||||
writeTask(() => scrollEl!.style.setProperty(overflowProperty, 'hidden'));
|
||||
|
||||
const animationType = getRefresherAnimationType(contentEl);
|
||||
const animation = createPullingAnimation(animationType, pullingRefresherIcon, this.el);
|
||||
@ -378,7 +381,10 @@ export class Refresher implements ComponentInterface {
|
||||
|
||||
this.gesture!.enable(false);
|
||||
|
||||
writeTask(() => this.scrollEl!.style.removeProperty('--overflow'));
|
||||
const { scrollEl } = this;
|
||||
const overflowProperty = scrollEl!.matches(ION_CONTENT_CLASS_SELECTOR) ? 'overflow' : '--overflow';
|
||||
writeTask(() => scrollEl!.style.removeProperty(overflowProperty));
|
||||
|
||||
if (this.progress <= 0.4) {
|
||||
ev.data.animation.progressEnd(0, this.progress, 500).onFinish(() => {
|
||||
this.animations.forEach((ani) => ani.destroy());
|
||||
|
||||
Reference in New Issue
Block a user