[Bug] [2020.04] TextInput onChange lose focus
See original GitHub issueAfter 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
In React ES6, why does the input field lose focus after typing a ...
When your onChange event fires, the callback calls setState with the new title value, which gets passed to your text field as a...
Read more >React Text Input Losing Focus After Each Keypress
React Text Input Losing Focus After Each Keypress. This bug took me a while to figure out, so I thought I would share...
Read more >[v6] fields losing focus after first onChange #1094 - GitHub
The losing focus bug is not a bug. It's the expected React behavior. If you are defining your component as an arrow function...
Read more >Gallery Fields Lose Focus OnChange
The problem is when tabbing or clicking to the next field, the OnChange fires and the field loses focus.
Read more >[Fix Input Popup Losing Focus] I don't understand what ...
Hey Leonardo, I assume this is a known issue with Outsystems and this module is a workaround?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m investigating this now and it seems to be a problem on any
<input>
element inside of a table row. It also appears to occur on"@patternfly/react-table": "2.24.41"
which is what kiali is using. Will update once I find a fix…Ok @redallen let me do some research. Thanks !!!