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

Commit

Permalink
fix(textbox): remove clear div
Browse files Browse the repository at this point in the history
  • Loading branch information
DeekyJay committed May 23, 2018
1 parent fd22633 commit eec2a26
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions src/prefabs/textbox/textbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ export class TextBox extends PreactControl<{
tabIndex={0}
value={this.state.inputValue}
/>
<div
role="button"
class={classes({
clearText: true,
disabled: !this.state.inputValue,
})}
onClick={this.reset}
>
x
</div>
{!this.hasSubmit && !this.cost
? [<CoolDown cooldown={this.cooldown} onCooldownEnd={this.endCooldown} />]
: null}
Expand Down Expand Up @@ -148,14 +138,17 @@ export class TextBox extends PreactControl<{
};

protected handleChange = (evt: any) => {
this.setState({
...this.state,
inputValue: evt.target.value,
}, () => {
if (!this.multiline && !this.hasSubmit && !this.cost) {
this.control.giveInput({ event: 'change', value: this.state.inputValue });
}
});
this.setState(
{
...this.state,
inputValue: evt.target.value,
},
() => {
if (!this.multiline && !this.hasSubmit && !this.cost) {
this.control.giveInput({ event: 'change', value: this.state.inputValue });
}
},
);
};

protected keypress = (evt: KeyboardEvent) => {
Expand Down

0 comments on commit eec2a26

Please sign in to comment.