[
https://issues.apache.org/jira/browse/WICKET-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16645346#comment-16645346
]
ASF GitHub Bot commented on WICKET-5552:
----------------------------------------
Github user svenmeier commented on the issue:
https://github.com/apache/wicket/pull/294
Why so complicated - I've fixed the issue by removing the mouse blocker
from modal.js and restricting any dragging on the element itself:
```
diff --git
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 64852de..8d94b36 100644
---
a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++
b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -2485,6 +2485,10 @@
mouseDownHandler: function (e) {
e = Wicket.Event.fix(e);
+
+ if (e.target !== this) {
+ return;
+ }
var element = this;
diff --git
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
index f683119..5a0f122 100644
---
a/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
+++
b/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
@@ -1189,7 +1189,7 @@
"<div class=\"w_left\"
id='"+idLeft+"'>"+
"<div class=\"w_right_1\">"+
"<div class=\"w_right\"
id='"+idRight+"'>"+
- "<div
class=\"w_content_1\" onmousedown=\"Wicket.Event.stop(event);\">"+
+ "<div
class=\"w_content_1\" >"+
"<div
class=\"w_caption\" id=\""+idCaption+"\">"+
"<a class=\"w_close\" style=\"z-index:1\" href=\"#\"></a>"+
"<h3 id=\""+idCaptionText+"\" class=\"w_captionText\"></h3>"+
```
Can you try that instead?
> Events to close pop-up on Modal Window are not propagated
> ---------------------------------------------------------
>
> Key: WICKET-5552
> URL: https://issues.apache.org/jira/browse/WICKET-5552
> Project: Wicket
> Issue Type: Bug
> Components: wicket-extensions
> Affects Versions: 6.14.0
> Environment: Windows/Eclipse/JRE7
> Reporter: Neil Bennett
> Priority: Major
> Labels: javascript, modalwindow
> Attachments: quickstart.zip
>
>
> When using a field on a modal window that shows a pop-up window, like a time
> picker, when clicking outside of the pop-up window but over the modal window,
> mousedown/click events are not propagated. Clicks outside of the modal window
> are propagated.
> This is due to Wicket.Event.stop(event) being called on mousedown on the
> w_content_1 component. Removal of this leads to the Drag javascript being
> executed which itself calls Wicket.Event.stop(event), disabling this then
> propagates the event which leads to the pop-up window being closed but causes
> any field on the modalwindow to get focus.
> I have a quickstart that demonstrates the modalwindow behavior vs that on a
> page. You will see that launching the modal window and clicking on the time
> component opens the pop-up window. However, you can only get this to close
> when clicking outside of the modal window. The same component has been put on
> the main page as a comparison which does close when clicking outside of the
> pop-up window.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)