Smoothly scroll to today with lots of due items

scroll-to-today includes the height of the today element in the offset
pased to animator.scrollTo, to be sure today's date is included on
screen when today's item is focused. When the today element was the
whole Grouping, and there are many items due today, this caused
problems.  The fix is to include just the <h2> that holds today's date
in the offset.

fixes ADMIN-1021

test plan:
  - create 9 items due today
  - scroll Today out of the visible area
  - click Today
  > expect the planner to smoothly scroll Today into view and focus one
  > of today's items (it should be the first one, but that will get
  > addressed in the ticket that controls fixes ordering)

Change-Id: I32fc13de3e5fd3f1f8ba3cf89396b95817ae3f3d
Reviewed-on: https://gerrit.instructure.com/149494
Tested-by: Jenkins
Reviewed-by: Dan Minkevitch <dan@instructure.com>
QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
This commit is contained in:
Ed Schiebel 2018-05-08 10:05:07 -04:00
parent dae6cbf462
commit 4f65397a90
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ import { alert } from '../../utilities/alertUtils';
export class ScrollToToday extends Animation {
uiDidUpdate () {
const t = this.document().querySelector('.planner-today');
const t = this.document().querySelector('.planner-today h2');
if (t) {
scrollAndFocusTodayItem(this.manager(), t);
} else {