From b85d4a05494f46bc3eef812dd058e9dc06a4a41f Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 7 Aug 2018 23:18:11 +0200 Subject: [PATCH] fix(popover): ion-scroll sizing fixes #14911 --- core/src/components/content/content.scss | 8 ++++++-- core/src/components/content/content.tsx | 3 ++- core/src/components/scroll/scroll.scss | 2 ++ core/src/utils/animations/ios.transition.ts | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/src/components/content/content.scss b/core/src/components/content/content.scss index 00f549e66a..2d8f5042aa 100644 --- a/core/src/components/content/content.scss +++ b/core/src/components/content/content.scss @@ -35,8 +35,6 @@ contain: layout size style; } - - :host(.scroll-disabled), ion-scroll { @include padding( @@ -51,3 +49,9 @@ ion-scroll { :host(.outer-content) { --ion-color-base: #{$background-color-step-50}; } + +:host(.content-size) ion-scroll { + position: relative; + + contain: none; +} diff --git a/core/src/components/content/content.tsx b/core/src/components/content/content.tsx index d24fc4bb78..e7486f1161 100644 --- a/core/src/components/content/content.tsx +++ b/core/src/components/content/content.tsx @@ -1,7 +1,7 @@ import { Component, Element, Listen, Method, Prop, QueueApi } from '@stencil/core'; import { Color, Config, Mode } from '../../interface'; -import { createColorClasses } from '../../utils/theme'; +import { createColorClasses, hostContext } from '../../utils/theme'; @Component({ tag: 'ion-content', @@ -93,6 +93,7 @@ export class Content { return { class: { ...createColorClasses(this.color), + 'content-size': hostContext('ion-popover', this.el), 'scroll-disabled': !this.scrollEnabled, } }; diff --git a/core/src/components/scroll/scroll.scss b/core/src/components/scroll/scroll.scss index 14068c83fc..81ee772913 100644 --- a/core/src/components/scroll/scroll.scss +++ b/core/src/components/scroll/scroll.scss @@ -12,6 +12,8 @@ overflow-y: auto; -webkit-overflow-scrolling: touch; will-change: scroll-position; + + box-sizing: border-box; } :host(.overscroll)::before, diff --git a/core/src/utils/animations/ios.transition.ts b/core/src/utils/animations/ios.transition.ts index 17bf3852a5..0b96940795 100644 --- a/core/src/utils/animations/ios.transition.ts +++ b/core/src/utils/animations/ios.transition.ts @@ -47,7 +47,7 @@ export function iosTransitionAnimation(AnimationC: Animation, navEl: HTMLElement const enteringContent = new AnimationC(); if (!contentEl && !enteringToolBarEle && headerEls.length === 0) { - enteringContent.addElement(enteringEl.querySelector(':scope > ion-page, :scope > ion-nav, :scope > ion-tabs')); + enteringContent.addElement(enteringEl.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs')); } else { enteringContent.addElement(contentEl); enteringContent.addElement(headerEls);