angular-ui/ui-grid

Editing a cell partially in view fails

Open

#5161 aperta il 23 feb 2016

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
good first issue

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

This happens when there are enough rows to warrant vertical scrolling. You can kind of see what's happening better on IE11, but it fails in Chrome too.

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

Steps to reproduce:

  1. Scroll to bottom row.
  2. Row 3 should be about half visible.
  3. Double-click the "Gender" column on row 3 to begin editing.
  4. Row 3 scrolls into view and the editor starts and stops instantly.
  5. If you haven't manually scrolled, none of the edits for row 3 work until you scroll.

From the debugging I've done, when beginEditAfterScroll() in the uiGridCell directive runs, it sets up the deregOnGridScroll() function. This function is invoked immediately after edit begins so the edit is immediately canceled.

It may be that Grid.prototype.scrollToIfNecessary() is trying to scroll when its not needed.

Guida contributor