mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +08:00
@ -28,6 +28,10 @@ export class TextView extends TextViewBaseCommon {
|
||||
|
||||
this.nativeTextViewProtected.setMaxLines(value);
|
||||
}
|
||||
|
||||
public _onReturnPress() {
|
||||
this.notify({ eventName: TextView.returnPressEvent, object: this });
|
||||
}
|
||||
}
|
||||
|
||||
TextView.prototype.recycleNativeView = 'auto';
|
||||
|
@ -167,6 +167,10 @@ export class TextView extends TextViewBaseCommon {
|
||||
}
|
||||
}
|
||||
|
||||
if (replacementString === '\n') {
|
||||
this.notify({ eventName: TextView.returnPressEvent, object: this });
|
||||
}
|
||||
|
||||
if (this.formattedText) {
|
||||
_updateCharactersInRangeReplacementString(this.formattedText, range.location, range.length, replacementString);
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import { EditableTextBase } from '../editable-text-base';
|
||||
import { Property } from '../core/properties';
|
||||
|
||||
export class TextViewBase extends EditableTextBase implements TextViewDefinition {
|
||||
public static returnPressEvent = 'returnPress';
|
||||
public maxLines: number;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user