Skip to content

[Bug] [2020.04] TextInput onChange lose focus #4072

@aljesusg

Description

@aljesusg

After upgrade when the value change the textInput lost focus, it seems that is rendering again the component in onChange event. (See Gif)

Component

<TextInput
                value={this.state.addEgressHost.host}
                type="text"
                id="addEgressHost"
                key="addEgressHost"
                aria-describedby="add egress host"
                name="addHost"
                onChange={this.onAddHost}
                isValid={this.state.validEgressHost}
              />

OnAddHost method

  onAddHost = (value: string, _) => {
    const host = value.trim();
    this.setState({
      addEgressHost: {
        host: host
      },
      validEgressHost: isServerHostValid(host)
    });
  };

GIF

ezgif-4-5a5a26e8e121

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions