Open Bug 1274838 Opened 6 years ago Updated 6 years ago
Updating the DOM in an overflow event handler causes smooth scroll
Into View to fail
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.8.0 Build ID: 20160426225641 Steps to reproduce: See codepen at http://codepen.io/anon/pen/WwVwqL or attached test case. Press the "add crumb and scroll" button. This button adds an item #second to the container; triggering an overflow event which prepends another item; (#start) and calls "scrollIntoView" on #second. Actual results: The second item is not scrolled into view; it remains to the right of the visible area. Expected results: The second item should have been scrolled into view. Subsequent calls to "scrollIntoView" should also correctly scroll the item.
Sorry; simplified the test case - the call to scrollIntoView during the overflow is irrelevant; it's the call in the click handler that's coming before the reflow I guess. This does not occur when using "behavior: 'instant'" in the call to scrollIntoView; only with "behavior: 'smooth'".
Attachment #8755200 - Attachment is obsolete: true
Summary: scrollIntoView called in overflow event handler; followed by another scroll fails to scroll correctly → Updating the DOM in an overflow event handler causes smooth scrollIntoView to fail
You need to log in before you can comment on or make changes to this bug.