FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(ios): textview content clipped on every other newline by manoldonev · Pull Request #6864 · NativeScript/NativeScript · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ts  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 11 additions & 1 deletion tns-core-modules/ui/text-view/text-view.ios.ts
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
}
}

class NoScrollAnimationUITextView extends UITextView {
// see https://github.com/NativeScript/NativeScript/issues/6863
// UITextView internally scrolls the text you are currently typing to visible when newline character
// is typed but the scroll animation is not needed because at the same time we are expanding
// the textview (setting its frame)
public setContentOffsetAnimated(contentOffset: CGPoint, animated: boolean): void {
super.setContentOffsetAnimated(contentOffset, false);
}
}

@CSSType("TextView")
export class TextView extends EditableTextBase implements TextViewDefinition {
nativeViewProtected: UITextView;
Expand All @@ -103,7 +113,7 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
public _isEditing: boolean;

createNativeView() {
const textView = UITextView.new();
const textView = NoScrollAnimationUITextView.new();
if (!textView.font) {
textView.font = UIFont.systemFontOfSize(12);
}
Expand Down

Back | FazBrowse Home | New Git URL