This repository was archived by the owner on Jul 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed
Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -108,16 +108,6 @@ export class TextBox extends PreactControl<{
108108 tabIndex = { 0 }
109109 value = { this . state . inputValue }
110110 />
111- < div
112- role = "button"
113- class = { classes ( {
114- clearText : true ,
115- disabled : ! this . state . inputValue ,
116- } ) }
117- onClick = { this . reset }
118- >
119- x
120- </ div >
121111 { ! this . hasSubmit && ! this . cost
122112 ? [ < CoolDown cooldown = { this . cooldown } onCooldownEnd = { this . endCooldown } /> ]
123113 : null }
@@ -148,14 +138,17 @@ export class TextBox extends PreactControl<{
148138 } ;
149139
150140 protected handleChange = ( evt : any ) => {
151- this . setState ( {
152- ...this . state ,
153- inputValue : evt . target . value ,
154- } , ( ) => {
155- if ( ! this . multiline && ! this . hasSubmit && ! this . cost ) {
156- this . control . giveInput ( { event : 'change' , value : this . state . inputValue } ) ;
157- }
158- } ) ;
141+ this . setState (
142+ {
143+ ...this . state ,
144+ inputValue : evt . target . value ,
145+ } ,
146+ ( ) => {
147+ if ( ! this . multiline && ! this . hasSubmit && ! this . cost ) {
148+ this . control . giveInput ( { event : 'change' , value : this . state . inputValue } ) ;
149+ }
150+ } ,
151+ ) ;
159152 } ;
160153
161154 protected keypress = ( evt : KeyboardEvent ) => {
You can’t perform that action at this time.
0 commit comments