@@ -6,6 +6,7 @@ import utils = require("utils/utils");
6
6
7
7
export class EditableTextBase extends common . EditableTextBase {
8
8
private _android : android . widget . EditText ;
9
+ private _textWatcher : android . text . TextWatcher ;
9
10
/* tslint:disable */
10
11
private _dirtyTextAccumulator : string ;
11
12
/* tslint:enable */
@@ -25,7 +26,7 @@ export class EditableTextBase extends common.EditableTextBase {
25
26
26
27
var that = new WeakRef ( this ) ;
27
28
28
- var textWatcher = new android . text . TextWatcher ( {
29
+ this . _textWatcher = new android . text . TextWatcher ( {
29
30
beforeTextChanged : function ( text : string , start : number , count : number , after : number ) {
30
31
//
31
32
} ,
@@ -35,9 +36,9 @@ export class EditableTextBase extends common.EditableTextBase {
35
36
return ;
36
37
}
37
38
var selectionStart = owner . android . getSelectionStart ( ) ;
38
- owner . android . removeTextChangedListener ( textWatcher ) ;
39
+ owner . android . removeTextChangedListener ( owner . _textWatcher ) ;
39
40
owner . style . _updateTextTransform ( ) ;
40
- owner . android . addTextChangedListener ( textWatcher ) ;
41
+ owner . android . addTextChangedListener ( owner . _textWatcher ) ;
41
42
owner . android . setSelection ( selectionStart ) ;
42
43
} ,
43
44
afterTextChanged : function ( editable : android . text . IEditable ) {
@@ -59,7 +60,7 @@ export class EditableTextBase extends common.EditableTextBase {
59
60
}
60
61
}
61
62
} ) ;
62
- this . _android . addTextChangedListener ( textWatcher ) ;
63
+ this . _android . addTextChangedListener ( this . _textWatcher ) ;
63
64
64
65
var focusChangeListener = new android . view . View . OnFocusChangeListener ( {
65
66
onFocusChange : function ( view : android . view . View , hasFocus : boolean ) {
0 commit comments