最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Ag-grid cell focus moves to another cell when rows are addedremoved above it - Stack Overflow

programmeradmin3浏览0评论

When adding or removing a row above a focused cell in ag-grid, the focus moves automatically to the cell that gets "in the place" of the previously focused cell.

So if a cell on row 4 is focused, and a new row is added at the top of the grid, the focus moves to the cell that was previously on row 3, and now it's on row 4 because of the new insertion.

While this might make sense in some scenarios, this affects cell editing in a very bad way, because it stops the editing of a cell when a new row is added above. This means that an incomplete value can be persisted, eg "12" because the user was trying to type "1234" but the row insertion happened in between.

The funny thing is that rows can be freely added/removed below the focused cell, and because the focused cell does not change its row index, it remains focused/in edit mode, so no problem in that scenario.

One other thing is that row selection is not affected, the selected row will remain the same based on its id and not its row index, when other rows are added/removed above it.

How can I convince ag-grid to keep the focus on a cell based on identity, not row index, when its row index changes? Thank you!

发布评论

评论列表(0)

  1. 暂无评论