PDA

View Full Version : Showing a layer above current scroll position scrolls up



ZachG
8 Apr 2011, 8:06 AM
(This is related to this (http://www.sencha.com/forum/showthread.php?129598-Opening-an-Ext.Window-in-an-iframe-scrolls-outer-frame) post I made earlier, but is more specific with the issue.)

When showing an Ext.Layer whose topmost pixel is above the currently visible top pixel, the browser will scroll up to the layer's topmost pixel is visible. This is a problem in a situation like the following:

http://kjhkstream.org/test/outer.html

If you scroll down to the bottom of the iframe, you'll see the "Open Window" link. Keep scrolling down on the main frame so all you can see is that link. Clicking on it creates a 200x300 Ext.Window and shows it. At some time after it shows it, the outer frame scrolls up so that the window is visible.

The window has a tbar with a menu, a combo box, and a time field. There are three links that are now visible that will show each of those components. By scrolling down on the outer frame to where only the link is visible and clicking, the outer frame will scroll up so that the layer's topmost pixel is visible.

I believe this is related to either something in the layer or element code since layer extends element and all four components (window, menu, combo box, and time field) have their layers shown in the bottom three links. I'm just not sure what it could be. The iframe html document is located on a different server than the outer document, so the same origin policy should be restricting the iframe to not affect the outer frame through Javascript.

ZachG
12 Apr 2011, 6:11 AM
Because no one has replied yet, I'll take a shot at looking through the Ext source to find why this is occuring. Hopefully someone out there knows, because this is a problem I need fixed.

ZachG
14 Apr 2011, 7:35 AM
It's because on show it's doing focusEl.focus() after 10 milliseconds. (Line 28220 of 3.3). I was able to set my window's focus function to the empty function, but it would be nice if there was a configuration that I could set to disable it calling focus.