-
-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input always losing focus when setNewState to data array #420
Comments
react virtualized has no issue at all https://codesandbox.io/s/react-virtualized-list-with-width-100-7btt7 |
Don't define your item renderer inline. It will get recreated each time the parent component re-renders which will mess with text selection apparently. |
If this is the case the docs should probably reflect it: This just tripped me and had no idea why my rows were unmounting. |
Hi I seem to be having a similar issue where my inputs are losing focus after typing one character and the scrollbar jumps up immediately after losing focus This is what my code looks like:
}` |
The same answer applies as above: Don't define your renderer inline. Any time any of the things in your dependencies array change (entireUnit, preConstruction, demolition, livingDining, kitchen, bedroom, bathroom, powder, misc, entireUnitQuantities, preConQuantities, demoQuantities, livingDiningQuantities, kitchenQuantities, bedroomQuantities, bathroomQuantities, powderQuantities, miscQuantities) your renderer will be recreated, and state for things like text inputs will be lost. |
can you maybe elaborate more on this? im not exactly sure how to tackle this. |
Did you check out the comment above before the issue was closed? They link to a suggested solution. |
Yes, but the codesandbox isn't working in it, so its not really providing any clues |
I think I see it now, the item renderer shouldn't be inside the component but outside the component, am I correct in that assumption? |
Yes, that is how the issue is resolved, the item renderer shouldn't be inside the component but outside the component |
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the rendered function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the rendered function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit ensures that the renderer function is defined at the top-level, and not inline.
See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level. This does not appear to have functional impact as of now, but will come in handy after #4376.
See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level. This does not appear to have functional impact as of now, but will come in handy after #4376.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level.
...upon re-render. See bvaughn/react-window#420 (comment). This commit ensures that the renderer function is defined at the top-level, and not inline.
See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level. This does not appear to have functional impact as of now, but will come in handy after #4376.
See bvaughn/react-window#420 (comment). This commit simply moves the renderer function definition from inline to top-level. This does not appear to have functional impact as of now, but will come in handy after #4376.
...upon re-render. And a re-render can happen when new items get loaded in `InfiniteLoader`. Addresses this issue: bvaughn/react-window#420 (comment). This commit simply moves the renderer function definitions from inline to top-level.
please try this codesand box, when you key something on textbox, it loses focus
https://codesandbox.io/s/react-window-x9gwc
The text was updated successfully, but these errors were encountered: