# How to avoid focus to anchor component on open modal window

eclipse1
21 4

Hi!

I have a modal window where most of the components are labels and I have one anchor element at the end of the window. When I open the window, the anchor element gets the automatically focused which results in the page being scrolled down to that anchor element.

How can I avoid this behaviour so that the page does not scroll down when I open it?

Edit: My version is ZK EE 7.0.2.

delete retag edit

Sort by » oldest newest most voted

chillworld
5322 4 9
https://github.com/chillw...

Simple trick :

Set this first in your window :

<textbox visible="false"/>


Example fiddle.

Greetz chill.

cyiannoulis
1191 10

Same thing here! ZK version 7.0.2

/Costas

mayuranjan
1 1

same here, I want to remove default onLoad focus from textbox

WilliamB
1609 1 6

Same here ... Did you guys find a solution to that?

Only work around I found atm is scrolling back up through JS called in the @init method with Clients.evalJavaScript, as I did not want to bind component in my VM (but this is not much better).

eclipse1
21 4

We did not find any solution, just a workaround. We put a hidden anchor on top of the page.

[hide preview]