IE bug when closing modal window

1

1 connu

Hi,

I dont have any knowlegde of Js.
But I have a problem with javascript using a java web framework. It's about
a modal window component.
When closing the modal window, the original page scrolls downs to the
bottom. This come from a Internet Explorer bug. Everything is ok with
Firefox.
I found a patch for solving the problem in
https://issues.apache.org/jira/browse/WICKET-1265

I have try to used this patch without any success :

I analyzed the javascript code of the ModalWindow (modal.js) and the
problem is by the solution of the focus problem:
if (Wicket.Browser.isIE()) {
// There's a strange focus problem in IE that disables focus on entire
page,
// unless something focuses an input
var e = document.createElement("input");
document.body.appendChild(e);
e.focus();
document.body.removeChild(e);
}


The better solution, that ie don't scrolls to bottom, is:
if (Wicket.Browser.isIE()) {
// There's a strange focus problem in IE that disables focus on entire
page,
// unless something focuses an input
var e = document.createElement("input");
document.body.insertBefore(e, document.body.firstChild);
e.focus();
document.body.removeChild(e);
}


I encosed the modal.js. Thanks in advance for any help.


Pierre
 
A

andre.winkler

Hi,

I dont have any knowlegde of Js.
But I have a problem with javascript using a java web framework. It's about
a modal window component.
When closing the modal window, the original page scrolls downs to the
bottom. This come from a Internet Explorer bug. Everything is ok with
Firefox.
I found a patch for solving the problem inhttps://issues.apache.org/jira/browse/WICKET-1265

I have try to used this patch without any success :

I analyzed the javascript code of the ModalWindow (modal.js) and the
problem is by the solution of the focus problem:
if (Wicket.Browser.isIE()) {
// There's a strange focus problem in IE that disables focus on entire
page,
// unless something focuses an input
var e = document.createElement("input");
document.body.appendChild(e);
e.focus();
document.body.removeChild(e);

}

The better solution, that ie don't scrolls to bottom, is:
if (Wicket.Browser.isIE()) {
// There's a strange focus problem in IE that disables focus on entire
page,
// unless something focuses an input
var e = document.createElement("input");
document.body.insertBefore(e, document.body.firstChild);
e.focus();
document.body.removeChild(e);

}

I encosed the modal.js. Thanks in advance for any help.

Pierre

Hi Pierre

The http://www.awitsolutions.ch development blog provided that bugfix
and added the issue. You have changed the modal.js in the jar file and
it doesn't works?

In addition, wicket provides a solution in the next version 3.1.2 or
3.1.3!

Greetings
André
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top