Skip to content

Commit

Permalink
fix(keyboard): overflow: visible on scroll view when keyboard is open
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlancina committed Apr 20, 2015
1 parent 7db6c7f commit edb62c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/views/scrollView.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
// D - A or B - A if D > B D - A max(0, D - B)
scrollViewOffsetHeight = scrollViewOffsetHeight - keyboardOffset;
container.style.height = scrollViewOffsetHeight + "px";
container.style.overflow = "visible";

//update scroll view
self.resize();
Expand Down Expand Up @@ -752,6 +753,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
if ( self.isShrunkForKeyboard ) {
self.isShrunkForKeyboard = false;
container.style.height = "";
container.style.overflow = "";
}
self.resize();
};
Expand Down
1 change: 1 addition & 0 deletions test/unit/views/scrollView.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe('Scroll View', function() {
expect(sv.resize).toHaveBeenCalled();
expect(sv.isShrunkForKeyboard).toBe(true);
expect(sc.style.height).toEqual("248px");
expect(sc.style.overflow).toEqual("visible");

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

0 comments on commit edb62c2

Please sign in to comment.