Skip to content

Commit edb62c2

Browse files
committed
fix(keyboard): overflow: visible on scroll view when keyboard is open
When using JS scrolling, prevents the web view from automatically scrolling inputs into view when they are either scrolled under the keyboard or already below the keyboard and typed into.
1 parent 7db6c7f commit edb62c2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: js/views/scrollView.js

+2
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
687687
// D - A or B - A if D > B D - A max(0, D - B)
688688
scrollViewOffsetHeight = scrollViewOffsetHeight - keyboardOffset;
689689
container.style.height = scrollViewOffsetHeight + "px";
690+
container.style.overflow = "visible";
690691

691692
//update scroll view
692693
self.resize();
@@ -752,6 +753,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
752753
if ( self.isShrunkForKeyboard ) {
753754
self.isShrunkForKeyboard = false;
754755
container.style.height = "";
756+
container.style.overflow = "";
755757
}
756758
self.resize();
757759
};

Diff for: test/unit/views/scrollView.unit.js

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ describe('Scroll View', function() {
7373
expect(sv.resize).toHaveBeenCalled();
7474
expect(sv.isShrunkForKeyboard).toBe(true);
7575
expect(sc.style.height).toEqual("248px");
76+
expect(sc.style.overflow).toEqual("visible");
7677

7778
ionic.trigger('scrollChildIntoView', details, true);
7879
//already shrunk, so shouldn't resize again

0 commit comments

Comments
 (0)