Grid loses focus during inline editing with custom editor

1 Answer 356 Views
General Discussions Grid
Darshan
Top achievements
Rank 1
Iron
Iron
Darshan asked on 17 Jun 2023, 05:38 AM

i followed the example provided in the docs to replicate inline editing for my scenario.

However after clicking on edit button , for every keystroke the input loses focus.

I observed that After removing the below parameter code works fine:

dataItemKey={product id}

 

What is the use of this parameter and how does specifying it (uniquely or not) affects focus on the input text box while typing.

 

Please advise.

 

 


https://www.telerik.com/kendo-react-ui/components/grid/editing/editing-custom/

Filip
Telerik team
commented on 20 Jun 2023, 12:20 PM

Hi, Darshan,

I inspected the provided demo, however, it seems that the keystroke issue is not occurring, even if the dataItemKey prop is being used. This prop sets the grid row key prop to the value of the field in the dataItem, if it is not set, the dataItem index will be used for the row key.

The issue of losing focus usually occurs if something in the implementation is causing React to re-mount on each render. I can recommend inspecting if there are any components defined inside the main one and defining them outside the main one, as that can cause that issue, in case this is not what is causing this behavior can you send a runnable, reproducible example with your current implementation so that we can debug it locally and investigate what is causing this?

Regards,
Filip

1 Answer, 1 is accepted

Sort by
0
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
answered on 23 Jun 2023, 01:23 PM
You might be running into this issue: https://stackoverflow.com/a/65603418 (I've run into it before when first working with Kendo - it was a React issue but found it because I was working in Kendo at the time)
Tags
General Discussions Grid
Asked by
Darshan
Top achievements
Rank 1
Iron
Iron
Answers by
Janki
Top achievements
Rank 4
Bronze
Iron
Iron
Share this question
or