Closed Bug 280505 Opened 20 years ago Closed 20 years ago

scrollIntoView in scrollable divs causes entire page to scroll

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
trivial

Tracking

()

RESOLVED INVALID

People

(Reporter: awo101, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

When performing a scrollIntoView() operation on an item in a scrollable div, the
entire page scrolls as well as the content inside the scrollable div, even if
the div itself is already entirely visible.  While the item will scroll into
view in the div, the entire page will scroll as well.  This is unneccesary and
creates an unpleasant effect.

Note that in the example above, a hack is currently in place that causes the
page to scroll back to the top after performing scrollIntoView()s on the
scrollable divs.  Simply select items in one or two of the columns, and (for
example) use the red menu button at the top right of one of the columns to move
composers to the left.  YOu will see a jumping effect.

Reproducible: Always

Steps to Reproduce:
1.Create a scrollable div filled with items
2.Make enough space around it such that the window can scroll
3.With the scrollable div in view, use the scrollIntoView() method on one of the
items in the div.

Actual Results:  
While the item will scroll into view in the div, the entire page will scroll as
well.  This is unneccesary.

Expected Results:  
As in other browsers, the div should scroll, and if the item is in view (i.e the
scrollable div is already visible in the window), no other scrolling should be
performed.  This prevents awkward jumping motions.

This bug appears in all gecko based browsers on all systems tested so far,
although the latest version of moz has not been tested (firefox 1.0, Mozilla
1.6, Camino 0.8.2 on Linux/Windows/MacOS X where appropriate).  A thorough web
search has been conducted to find workaround for this issue, and there have been
several instances of others having the same issue without any satisfactory
workarounds known.
Ugh.  A look through the moz code told me what I was missing - the false
parameter to tell it not to scroll to the top.  My apologies.
Severity: normal → trivial
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.