Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.

Commit eec2a26

Browse files
author
Derek Jensen
committed
fix(textbox): remove clear div
1 parent fd22633 commit eec2a26

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

src/prefabs/textbox/textbox.tsx

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff 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) => {

0 commit comments

Comments
 (0)