FIX: Never show text-view hint while editing.

This commit is contained in:
vakrilov
2017-05-30 17:14:46 +03:00
parent 4b45c73c96
commit abe25d1286

View File

@ -28,6 +28,13 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
return true; return true;
} }
public textViewDidBeginEditing(textView: UITextView) {
var owner = this._owner.get();
if (owner) {
owner._isEditing = true;
}
}
public textViewDidEndEditing(textView: UITextView) { public textViewDidEndEditing(textView: UITextView) {
const owner = this._owner.get(); const owner = this._owner.get();
if (owner) { if (owner) {
@ -35,6 +42,7 @@ class UITextViewDelegateImpl extends NSObject implements UITextViewDelegate {
textProperty.nativeValueChange(owner, textView.text); textProperty.nativeValueChange(owner, textView.text);
} }
owner._isEditing = false;
owner.dismissSoftInput(); owner.dismissSoftInput();
owner._refreshHintState(owner.hint, textView.text); owner._refreshHintState(owner.hint, textView.text);
} }
@ -63,6 +71,7 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
private _ios: UITextView; private _ios: UITextView;
private _delegate: UITextViewDelegateImpl; private _delegate: UITextViewDelegateImpl;
private _isShowingHint: boolean; private _isShowingHint: boolean;
public _isEditing: boolean = false;
constructor() { constructor() {
super(); super();
@ -96,9 +105,10 @@ export class TextView extends EditableTextBase implements TextViewDefinition {
if (this.formattedText) { if (this.formattedText) {
return; return;
} }
if (text !== null && text !== undefined && text !== '') { if (text !== null && text !== undefined && text !== '') {
this.showText(); this.showText();
} else if (hint !== null && hint !== undefined && hint !== '') { } else if (!this._isEditing && hint !== null && hint !== undefined && hint !== '') {
this.showHint(hint); this.showHint(hint);
} else { } else {
this._isShowingHint = false; this._isShowingHint = false;