diff --git a/ionic/components/content/content.ts b/ionic/components/content/content.ts index 95c05426f4..f95d9dd1fe 100644 --- a/ionic/components/content/content.ts +++ b/ionic/components/content/content.ts @@ -200,27 +200,27 @@ export class Content extends Ion { this.scrollPadding = newScrollPadding; this.scrollElement.style.paddingBottom = newScrollPadding + 'px'; - if (!this.keyboardPromise) { - console.debug('add scroll keyboard close callback', newScrollPadding); - - this.keyboardPromise = this.keyboard.onClose(() => { - console.debug('scroll keyboard closed', newScrollPadding); - - if (this) { - if (this.scrollPadding && this.scrollElement) { - let close = new Animation(this.scrollElement); - close - .duration(150) - .fromTo('paddingBottom', this.scrollPadding + 'px', '0px') - .play(); - } - - this.scrollPadding = 0; - this.keyboardPromise = null; - } - }); - - } + // if (!this.keyboardPromise) { + // console.debug('add scroll keyboard close callback', newScrollPadding); + // + // this.keyboardPromise = this.keyboard.onClose(() => { + // console.debug('scroll keyboard closed', newScrollPadding); + // + // if (this) { + // if (this.scrollPadding && this.scrollElement) { + // let close = new Animation(this.scrollElement); + // close + // .duration(250) + // .fromTo('paddingBottom', this.scrollPadding + 'px', '0px') + // .play(); + // } + // + // this.scrollPadding = 0; + // this.keyboardPromise = null; + // } + // }); + // + // } } } diff --git a/ionic/components/text-input/text-input.ts b/ionic/components/text-input/text-input.ts index 328b4c42f5..167a9ee7ed 100644 --- a/ionic/components/text-input/text-input.ts +++ b/ionic/components/text-input/text-input.ts @@ -449,11 +449,7 @@ export class TextInputElement { let focusedInputEle = this.getNativeElement(); if (shouldRelocate) { - let clonedInputEle = focusedInputEle.cloneNode(true); - clonedInputEle.classList.add('cloned-input'); - clonedInputEle.classList.remove('hide-focused-input'); - clonedInputEle.setAttribute('aria-hidden', true); - clonedInputEle.tabIndex = -1; + let clonedInputEle = cloneInput(focusedInputEle, 'cloned-input'); focusedInputEle.classList.add('hide-focused-input'); focusedInputEle.style[dom.CSS.transform] = `translate3d(-9999px,${inputRelativeY}px,0)`; @@ -478,10 +474,7 @@ export class TextInputElement { let focusedInputEle = this.getNativeElement(); if (shouldHideFocus) { - let clonedInputEle = focusedInputEle.cloneNode(true); - clonedInputEle.classList.add('cloned-hidden'); - clonedInputEle.setAttribute('aria-hidden', true); - clonedInputEle.tabIndex = -1; + let clonedInputEle = cloneInput(focusedInputEle, 'cloned-hidden'); focusedInputEle.classList.add('hide-focused-input'); focusedInputEle.style[dom.CSS.transform] = 'translate3d(-9999px,0,0)'; @@ -526,6 +519,16 @@ class InputScrollAssist { } +function cloneInput(srcInput, addCssClass) { + let clonedInputEle = srcInput.cloneNode(true); + clonedInputEle.classList.add(addCssClass); + clonedInputEle.classList.remove('hide-focused-input'); + clonedInputEle.setAttribute('aria-hidden', true); + clonedInputEle.removeAttribute('aria-labelledby'); + clonedInputEle.tabIndex = -1; + return clonedInputEle; +} + const SCROLL_ASSIST_SPEED = 0.4; diff --git a/ionic/util/util.scss b/ionic/util/util.scss index c6f222d712..16aa188e65 100755 --- a/ionic/util/util.scss +++ b/ionic/util/util.scss @@ -126,6 +126,11 @@ focus-ctrl { pointer-events: none; } +[floating-label] .hide-focused-input, +[stacked-label] .hide-focused-input { + margin-top: -8px !important; +} + .cloned-input { pointer-events: none; }