From ccf0d7f9e5c929f7271ae3c7ed8d7f07866de270 Mon Sep 17 00:00:00 2001 From: Manduro Date: Mon, 12 Jun 2017 10:18:31 +0200 Subject: [PATCH] fix(refresher): border should only show when pulled Closes #10994 --- src/components/content/content.ts | 7 +++++++ src/components/refresher/refresher.ts | 1 + src/components/refresher/test/refresher.spec.ts | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/components/content/content.ts b/src/components/content/content.ts index e579123e09e..d9764f19b6c 100644 --- a/src/components/content/content.ts +++ b/src/components/content/content.ts @@ -212,6 +212,8 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent { /** @internal */ _fullscreen: boolean; /** @internal */ + _hasRefresher: boolean = false; + /** @internal */ _footerEle: HTMLElement; /** @internal */ _dirty: boolean; @@ -782,6 +784,11 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent { this._cBottom += this._tabbarHeight; } + // Refresher uses a border which should be hidden unless pulled + if (this._hasRefresher === true) { + this._cTop -= 1; + } + // Fixed content shouldn't include content padding this._fTop = this._cTop; this._fBottom = this._cBottom; diff --git a/src/components/refresher/refresher.ts b/src/components/refresher/refresher.ts index d22114311e7..2a98cf2e031 100644 --- a/src/components/refresher/refresher.ts +++ b/src/components/refresher/refresher.ts @@ -202,6 +202,7 @@ export class Refresher { constructor(private _plt: Platform, @Host() private _content: Content, private _zone: NgZone, gestureCtrl: GestureController) { this._events = new UIEventManager(_plt); + _content._hasRefresher = true; _content.setElementClass('has-refresher', true); this._gesture = gestureCtrl.createGesture({ name: GESTURE_REFRESHER, diff --git a/src/components/refresher/test/refresher.spec.ts b/src/components/refresher/test/refresher.spec.ts index 6d787c6de84..8f94b5aeb83 100644 --- a/src/components/refresher/test/refresher.spec.ts +++ b/src/components/refresher/test/refresher.spec.ts @@ -224,6 +224,9 @@ describe('Refresher', () => { }); + it('should set hasRefresher on content', () => { + expect(content._hasRefresher).toBeTruthy(); + }); let contentElementRef: any; let refresher: Refresher;