File tree Expand file tree Collapse file tree
tns-core-modules/ui/text-view Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,16 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
9595 }
9696}
9797
98+ class NoScrollAnimationUITextView extends UITextView {
99+ // see https://github.com/NativeScript/NativeScript/issues/6863
100+ // UITextView internally scrolls the text you are currently typing to visible when newline character
101+ // is typed but the scroll animation is not needed because at the same time we are expanding
102+ // the textview (setting its frame)
103+ public setContentOffsetAnimated ( contentOffset : CGPoint , animated : boolean ) : void {
104+ super . setContentOffsetAnimated ( contentOffset , false ) ;
105+ }
106+ }
107+
98108@CSSType ( "TextView" )
99109export class TextView extends EditableTextBase implements TextViewDefinition {
100110 nativeViewProtected : UITextView ;
@@ -103,7 +113,7 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
103113 public _isEditing : boolean ;
104114
105115 createNativeView ( ) {
106- const textView = UITextView . new ( ) ;
116+ const textView = NoScrollAnimationUITextView . new ( ) ;
107117 if ( ! textView . font ) {
108118 textView . font = UIFont . systemFontOfSize ( 12 ) ;
109119 }
You can’t perform that action at this time.
0 commit comments