Opened 9 years ago

Closed 9 years ago

#16306 closed defect (fixed)

dojox/mobile/IconContainer: when used with transition:below inside a ScrollableView, unwanted scroll can occur when opening the icon content

Reported by: Adrian Vasiliu Owned by: Eric Durocher
Priority: undecided Milestone: 1.9
Component: DojoX Mobile Version: 1.8.1
Keywords: Cc:
Blocked By: Blocking:


When a dojox/mobile/IconContainer, located inside a ScrollableView?, is used with the transition property set to "below", opening the icon content triggers an unnecessary and unpleasant scrolling of the ScrollableView? if the display area of the ScrollableView? is larger than its content.

How to reproduce:

  1. Launch mobileGallery on iPad or on a desktop browser (such that the window height is large enough).
  2. Open the "Icons" view.
  3. Touch the "Notes" icon.

==> This opens an IconItem? which has enough space for being placed below without any scroll, however the ScrollableView? gets scrolled until the IconItem? is aligned on the bottom. (On desktop browsers, resizing the window reverts this scroll. Closing the IconItem? also scrolls back to the original position.)

Can also be reproduced by modifying any dojox/mobile/tests/test_IconContainer*.html to use an IconContainer? with transition:below inside a ScrollableView?.

Attachments (1)

patch16306.patch (842 bytes) - added by Adrian Vasiliu 9 years ago.
Avoid unwanted scroll when opening icon items - Adrian Vasiliu, IBM, CCLA

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by Adrian Vasiliu

Attachment: patch16306.patch added

Avoid unwanted scroll when opening icon items - Adrian Vasiliu, IBM, CCLA

comment:1 Changed 9 years ago by Adrian Vasiliu

When used inside a ScrollableView with transition:below, IconContainer calls scrollable.scrollIntoView(true/*alignToTop*/). This works fine if the height of the display area is smaller than the content - which is often the case on phones. But on tablets or desktop browsers, this is often not the case, and scrollIntoView produces an unnecessary, unpleasant scroll (surprisingly, with bottom alignment instead of top alignment).

The attached patch avoids this unnecessary scroll while preserving the current behavior (the scroll) in all cases when it is really needed (including when there are more than one IconItem open).

Remark: I'm not sure the current behavior of scrollable.scrollIntoView is the expected one, in particular for the cases when it produces a bottom alignment while passing true for the alignToTop argument. This method happens to be used only by IconContainer (at least I didn't find other usages), but users may use it for different purposes (as a counter-part of element.scrollIntoView). In any case, for IconContainer what is needed is to avoid doing any scroll in some cases, hence the solution in this patch.

comment:2 Changed 9 years ago by cjolif

Milestone: tbd1.9

comment:3 Changed 9 years ago by cjolif

Resolution: fixed
Status: newclosed

In [29942]:

fixes #16306. Avoid unwanted scroll when opening icon items. Thanks Adrian Vasiliu (IBM, CCLA).

Note: See TracTickets for help on using tickets.