Created
February 7, 2016 16:52
-
-
Save mauritslamers/7184c58a4c2e3e5f4c09 to your computer and use it in GitHub Desktop.
this fixes text_field_view scrolling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _shouldScroll: function () { | |
| var t = this.$input()[0], | |
| h = this.get('frame').height, | |
| sh = t.scrollHeight, | |
| sTop = t.scrollTop; | |
| if (sh < h) return false; | |
| else { | |
| if (t.scrollTop + h >= sh) { | |
| return false; | |
| } | |
| else if (t.scrollTop !== 0) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| }, | |
| /** | |
| Adds mouse wheel support for textareas. | |
| */ | |
| mouseWheel: function (evt) { | |
| if (this.get('isTextArea')) { | |
| evt.allowDefault(); | |
| return this._shouldScroll(); | |
| } else return false; | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment