0

How to avoid focus to anchor component on open modal window

asked 2014-07-15 18:37:47 +0800

eclipse1 gravatar image eclipse1
21 4

updated 2014-07-17 10:36:04 +0800

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 flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
1

answered 2015-09-15 14:49:40 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

Simple trick :

Set this first in your window :

<textbox visible="false"/>

Example fiddle.

Greetz chill.

link publish delete flag offensive edit
0

answered 2014-07-16 12:12:44 +0800

cyiannoulis gravatar image cyiannoulis
1201 10

Same thing here! ZK version 7.0.2

/Costas

link publish delete flag offensive edit
0

answered 2015-08-09 05:12:14 +0800

mayuranjan gravatar image mayuranjan
1 1

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

link publish delete flag offensive edit
0

answered 2015-09-15 12:42:20 +0800

WilliamB gravatar image WilliamB
1609 1 6

updated 2015-09-15 13:30:08 +0800

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).

Made a fiddle to show the issue : http://zkfiddle.org/sample/3thplcj/3-Issue-with-navigation-scroll

link publish delete flag offensive edit
0

answered 2015-09-15 16:10:12 +0800

eclipse1 gravatar image eclipse1
21 4

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

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-07-15 18:37:47 +0800

Seen: 54 times

Last updated: Sep 15 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More