Wicket
  1. Wicket
  2. WICKET-4770

Wicket 6: modal windows in Safari are always in drag or resize mode

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0
    • Fix Version/s: 6.1.0
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Safari - all OS

      Description

      In Wicket 6 using Safari, a modal dialog will not allow interactions with form components. The whole dialog always seems to be in "drag" mode. Click anywhere on the panel and the dialog will drag.

      Interaction works fine with all other browsers.

        Activity

        Hide
        Geoff Hayman added a comment -

        Patch file to resolve issue

        Show
        Geoff Hayman added a comment - Patch file to resolve issue
        Hide
        Geoff Hayman added a comment -

        The modal dialog tries to set event.ignore=true if the browser is Safari. This Wicket event data structure used to be passed through to Wicket.Drag.mouseDownHandler as the argument e. However, in the switch over to jQuery events the argument (e) passed to mouseDownHandler is no longer Wicket "event". It is now jQuery event data.

        There is a test in mouseDownHandler to check for the existence of e.ignore. As this is now jQuery data, it never exists, so Safari is never recognized.

        I changed this test to check event.ignore and it appears to work correctly.

        Show
        Geoff Hayman added a comment - The modal dialog tries to set event.ignore=true if the browser is Safari. This Wicket event data structure used to be passed through to Wicket.Drag.mouseDownHandler as the argument e. However, in the switch over to jQuery events the argument (e) passed to mouseDownHandler is no longer Wicket "event". It is now jQuery event data. There is a test in mouseDownHandler to check for the existence of e.ignore. As this is now jQuery data, it never exists, so Safari is never recognized. I changed this test to check event.ignore and it appears to work correctly.
        Hide
        Emond Papegaaij added a comment -

        Although I don't know the code that well, I don't think the patch is correct. I cannot find any code that sets the 'ignore' flag on the jQuery event. Therefore is presume that with this patch, the if-condition will always be true. If that seems to work correctly, perhaps the solution is to remove the if entirely?

        Show
        Emond Papegaaij added a comment - Although I don't know the code that well, I don't think the patch is correct. I cannot find any code that sets the 'ignore' flag on the jQuery event. Therefore is presume that with this patch, the if-condition will always be true. If that seems to work correctly, perhaps the solution is to remove the if entirely?
        Hide
        Geoff Hayman added a comment -

        event.ignore is set on line 1200 of modal.js (Wicket 6.0). This is specifically NOT the jQuery event object which is why the later test was failing.

        When I changed the later test to test against event.ignore (non-jQuery object) rather than e.ignore (jQuery object) the function worked as expected.

        Whether this is 100% the correct change I will leave up to those more knowledgeable in the Wicket code, but I can say that it worked for us with no other apparent side effects.

        Show
        Geoff Hayman added a comment - event.ignore is set on line 1200 of modal.js (Wicket 6.0). This is specifically NOT the jQuery event object which is why the later test was failing. When I changed the later test to test against event.ignore (non-jQuery object) rather than e.ignore (jQuery object) the function worked as expected. Whether this is 100% the correct change I will leave up to those more knowledgeable in the Wicket code, but I can say that it worked for us with no other apparent side effects.
        Hide
        Emond Papegaaij added a comment - - edited

        Ok, I didn't expect wicket-ajax-jquery.js to contain hacks to just get modal windows working. I tried to find when this code was added, but it goes beyond recorded history of the ModalWindow. The first commit with this ignore flag is from the initial addition of modal window, back in august 2006. I highly doubt that this hack is still relevant. Unfortunately, I don't have Safari to test it in, so I'll ask Martijn to test if this hack can be removed.

        Show
        Emond Papegaaij added a comment - - edited Ok, I didn't expect wicket-ajax-jquery.js to contain hacks to just get modal windows working. I tried to find when this code was added, but it goes beyond recorded history of the ModalWindow. The first commit with this ignore flag is from the initial addition of modal window, back in august 2006. I highly doubt that this hack is still relevant. Unfortunately, I don't have Safari to test it in, so I'll ask Martijn to test if this hack can be removed.
        Hide
        Emond Papegaaij added a comment -

        A coworker tested my proposal on Safari, and the hack is no longer needed. I've removed the hack on both ends of the code.

        Show
        Emond Papegaaij added a comment - A coworker tested my proposal on Safari, and the hack is no longer needed. I've removed the hack on both ends of the code.

          People

          • Assignee:
            Emond Papegaaij
            Reporter:
            Geoff Hayman
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development