ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

scrollToFocus does not enable edit when enableCellEditOnFocus is set to true

Open moses-v51 opened this issue 10 years ago • 4 comments

When enableCellEditOnFocus is set to true, I expect that scrollToFocus will enable a cell's edit mode. However, it does not. In this plunker, which was taken from the cellNav examples and modified to add cellEdit, you can see that when clicking 'Focus Row 50, Balance' that it is merely highlighted. If you click into another balance first, the edit mode displays when clicking 'Focus Row 50, Balance'.

http://plnkr.co/edit/XTskI7y9CBsq5aBY8mSv?p=preview

moses-v51 avatar May 19 '16 01:05 moses-v51

I think this has to do with grid not ready (still scrolling) when edit is requested. scrollToFocus probably needs to put some sort of the timeout when calling focus.

bjaraujo avatar Jun 10 '16 09:06 bjaraujo

It has nothing to do with timeout. The problem is with 'if' condition here: https://github.com/angular-ui/ui-grid/blob/bcbd8433dcb8e69d13ea4281f426febf226986aa/src/features/edit/js/gridEdit.js#L537

evt parameter is undefined when scrollToFocus is used. So 'if' condition evaluates to false and beginEdit never gets called. Can anybody provide some workaround?

AlexanderKheimonen avatar Dec 28 '17 16:12 AlexanderKheimonen

It occurs in version 4.0.8 or later. (bcbd8433)

tomo357349 avatar Jan 15 '18 08:01 tomo357349

I believe this issue is resolved in the latest version of ui-grid

mportuga avatar Apr 05 '18 15:04 mportuga