From 8ab669604d8ed248f04b58d5af9d645e5a9405c5 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 19 Mar 2018 08:46:17 -0700 Subject: [PATCH] TextFieldTextEditor: exposed resetScrollOnFocusOut as a public property (closes #1659) --- .../controls/text/TextFieldTextEditor.as | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/source/feathers/controls/text/TextFieldTextEditor.as b/source/feathers/controls/text/TextFieldTextEditor.as index fe60452a3b..497c6bf905 100644 --- a/source/feathers/controls/text/TextFieldTextEditor.as +++ b/source/feathers/controls/text/TextFieldTextEditor.as @@ -1412,7 +1412,31 @@ package feathers.controls.text /** * @private */ - protected var resetScrollOnFocusOut:Boolean = true; + protected var _resetScrollOnFocusOut:Boolean = true; + + /** + * Indicates of the text editor resets its current scroll position to + * 0 on focus out. + * + *

In the following example, the scroll position is not reset on focus out:

+ * + * + * textEditor.resetScrollOnFocusOut = false; + * + * @default true + */ + public function get resetScrollOnFocusOut():Boolean + { + return this._resetScrollOnFocusOut; + } + + /** + * @private + */ + public function set resetScrollOnFocusOut(value:Boolean):void + { + this._resetScrollOnFocusOut = value; + } /** * @private @@ -2581,7 +2605,7 @@ package feathers.controls.text this._textFieldHasFocus = false; this.stage.removeEventListener(TouchEvent.TOUCH, stage_touchHandler); - if(this.resetScrollOnFocusOut) + if(this._resetScrollOnFocusOut) { this.textField.scrollH = this.textField.scrollV = 0; }