Hi Team,
We have a KendoReact Grid where (effectively) all rows are in edit mode (we set edit so each valid item is editable). One of the editable columns uses a custom edit cell that renders a NumericTextBox (quantity).
We also have a toolbar with an Input used to search/filter products. The toolbar Input onChange is debounced (lodash debounce), and on each debounced change we update the Grid filter/state.
Problem: when the debounced toolbar Input triggers a state update and the Grid re-processes data and re-renders rows, SOMETIMES one of the quantity NumericTextBox inputs auto-focuses. This steals focus from the search input while the user is still typing. The user then unknowingly continues typing, but now their keystrokes go into a quantity cell instead, causing incorrect quantities / incorrect lines ordered.
This is a serious UX/data integrity issue because users can accidentally edit quantities while they intend to keep typing the product search.
Expected Behaviour
When the user is typing in the toolbar search Input, focus should remain on that Input across Grid state changes (sorting/filtering/paging), and no cell editor should automatically take focus unless the user explicitly clicks into a cell or we explicitly programmatically focus it.
Source
I've tried to duplociate the error using a simplistic kendo example without luck but I've included the LineItemsGrid, LineItemsToolbar and the QuantityEditCell in this stackBlits for ref, see `MyFiles`. Note that this is NOT a working demo. There is just too much going on contextually to make a static working demo.
https://stackblitz.com/edit/react-2bkcpcjg?file=MyFiles%2FQuantityEditCell.tsx,MyFiles%2FLineItemsToolbar.tsx,MyFiles%2FLineItemsGrid.tsx
Any advise or way to tweak out where the bug could be would be helpful.
Thanks,
Grant