Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellnav rewrite and speed improvements #2084

Merged
merged 8 commits into from
Nov 13, 2014
Merged

Conversation

c0bra
Copy link
Contributor

@c0bra c0bra commented Nov 13, 2014

This is a large set of changes that focuses on reverting how we track elements within the the grid's row repeater. For the cellNav feature we changed to tracking by row.uid, which was causing us to recycle DOM elements at a very quick pace, resulting in thrashing the browser.

Going back to track by $index required rewriting the cellNav feature so that it no longer relies on "true" browser focus. but fakes it by handling click events and tracking the history of how we navigate cells. These changes to cellNav ALSO requiresdmany changes inside the edit feature, as it was implicitly relying on focus as well. We still do depend on focused elements, but only in the sense that we need to have them capture keyboard events.

There are also several speed improvements and fixes that were discovered in the course of this change, e.g. watches that shouldn't have been firing, calculations running when they shouldn't have and causing race conditions, etc.

The function was previously only allowing one parameter. Now the args just
get passed straight on to $log.debug
prevScrollLeft and prevScrollTop were being set improperly in the
adjustScroll* methods. Neither were accounting for the viewport, causing
the value to be too large. Now it only sets the value if the scrollLeft or
scrollTop argument is not provided, and it includes the viewport in the
calculation.

Also minor fixes within cellNav
The filter term watches were all firing whether or not there was a change
to the values!
applyHide() was running on all GRID_SCROLL events, whether or not the menu
was visible. This was causing excess $digest() loops.
renderContainers with no canvasWidth were having their heights calculated.
If their columns were wrapping around it would mean too large of a height
on that renderContainer, and thus would be propogated to ALL the other
containers (i.e. pinned containers).
When navigating beyond the left/right edges of grid around to the other
side, the grid was losing focus which prevented further navigation because
any keydown events were being sent to <body> (the new activeElement). This
fix causes the renderContainer to be REFOCUSED after a GRID_SCROLL event
in the case that the activeElement is document.body. We are assuming that
when scrolling within the grid, an element within the grid should have
focus.
When hitting the ESC key in a cell while editing it, the cell was losing
focus when it should have been retained. This fix accounts for the changes
to using actual CSS classes instead of relying on :focus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant