6.9.2: Header Filter Input Losing Focus After Keydown
See original GitHub issueIn 6.9.2, the open field text inputs in the header columns are losing focus after you press a key. I believe this came in with the 6.9.0 changes.
As a sidenote, I replaced the regular text inputs with a search
input, which is nice because you get the ‘clear’ button and it doesn’t trigger the browser’s autocomplete. Pretty sure that has nothing to do with losing focus, but I’ll keep testing.
FilterComponent={({ filter, onChange, column }) => (
<input
className="w-100"
type="search"
placeholder={column.Placeholder}
value={filter ? filter.value : ''}
onChange={event => onChange(event.target.value)}
/>
)}
Issue Analytics
- State:
- Created 5 years ago
- Comments:13
Top Results From Across the Web
6.9.2: Header Filter Input Losing Focus After Keydown #1266
In 6.9.2, the open field text inputs in the header columns are losing focus after you press a key. I believe this came...
Read more >react-table lost focus on filter? - Stack Overflow
Problem is the filter text field will lost focus after we type and even when we just touch the input (I know the...
Read more >React Text Input Losing Focus After Each Keypress
This bug took me a while to figure out, so I thought I would share the cause and the fix. I had a...
Read more >React Table Re-Renders, Losing Focus When Input Text In ...
In 6.9.2, the open field text inputs in the header columns are losing focus ... #22 submits the form after each keypress and...
Read more >User's Guide Avizo Software 2019 | Thermo Fisher Scientific
This manual has been prepared for Thermo Fisher Scientific licensees solely for use in connection with software supplied by Thermo Fisher Scientific and....
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
@tannerlinsley was correct. Moving the custom component from the render phase solved my issues.
Moving the columns declaration out of the render method (and using an uncontrolled input) worked for me. (Just refactoring to an external function as @boonep suggested didn’t in my case.)
Mine wasn’t working because
columns
was declared within therender()
function, so as @tannerlinsley pointed out (if my understanding is right) the original DOM elements were no longer accessible for React to diff with, so it re-rendered everything on every edit.