ICEfaces
  1. ICEfaces
  2. ICE-1289

Modal Dialogs do not disable offscreen space when window is resized

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6DR#6, 1.6
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      windows xp
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      A user submitted the following workaround:

      #iceModalFrame {
        background-color:#e2e2e2 !important;
        opacity:0.7 !important;
        width:100% !important;
        height:100% !important;
       }

      which handles window resizing, and the percentages can be increased over 100% to take into account scrolling, although this will also cause the scrollbars to be present even when the document size isn't larger than the viewport size
      Show
      A user submitted the following workaround: #iceModalFrame {   background-color:#e2e2e2 !important;   opacity:0.7 !important;   width:100% !important;   height:100% !important;  } which handles window resizing, and the percentages can be increased over 100% to take into account scrolling, although this will also cause the scrollbars to be present even when the document size isn't larger than the viewport size

      Description

      When using a modal popup dialog, the non-dialog portion of the screen is
      disabled so that interaction is only possible with the dialog. This can be
      circumvented on pages where the page size is larger than the viewport size. One
      is able to scroll to the previously off-screen portion of the page and interact
      with the page.

      1. supportilla-3919.zip
        7 kB
        Philip Breau
      2. test.xhtml
        2 kB
        dukehoops
      1. screenshot-1.jpg
        28 kB

        Issue Links

          Activity

          Hide
          Ken Fyten added a comment -

          Can fix the resize case for 1.6?

          Show
          Ken Fyten added a comment - Can fix the resize case for 1.6?
          Hide
          Mircea Toma added a comment -

          This is quite tricky to solve but it needs to be revisited. See: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow

          Show
          Mircea Toma added a comment - This is quite tricky to solve but it needs to be revisited. See: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
          Hide
          dukehoops added a comment -

          maybe I'm missing something, but could one simply set iframe's position to "position:fixed" instead of doing the above? This would cover the entire viewport (as opposed to page) and keep doing so after viewport's been resized.

          Tried it w/ Firefox 2.0 worked like a charm - no scrollbars.

          My change to bridge/lib/extras/style.js ln 114:

          BEFORE
          iframe.style.position = 'absolute';

          NOW:
          iframe.style.position = 'fixed';

          -nikita
          ps. AFAIK this is set in

          Show
          dukehoops added a comment - maybe I'm missing something, but could one simply set iframe's position to "position:fixed" instead of doing the above? This would cover the entire viewport (as opposed to page) and keep doing so after viewport's been resized. Tried it w/ Firefox 2.0 worked like a charm - no scrollbars. My change to bridge/lib/extras/style.js ln 114: BEFORE iframe.style.position = 'absolute'; NOW: iframe.style.position = 'fixed'; -nikita ps. AFAIK this is set in
          Hide
          dukehoops added a comment -

          answering my own question above: "position:fixed" and iframe does not render correctly in IE7. However this does:

          -replace iframe with div
          -show/hide dialog and modal div via toggling styles between 'display: none;' and 'display: block;'

          This approach:
          -works in IE7, Firefox
          -ensure entire viewport (browser window) is covered
          -handles window resizing
          -keeps dialog in the same position relative to viewport even when user scrolls.

          Please see sample test.xhtml (attached).

          What's missing:
          -ideally there'd be a JS method that would precisely center the dialog (position it)
          -this method would also have to handle user scrolling a long page (or disable scrollbars)

          Mircea/Philip:
          let me know what you think.

          Show
          dukehoops added a comment - answering my own question above: "position:fixed" and iframe does not render correctly in IE7. However this does: -replace iframe with div -show/hide dialog and modal div via toggling styles between 'display: none;' and 'display: block;' This approach: -works in IE7, Firefox -ensure entire viewport (browser window) is covered -handles window resizing -keeps dialog in the same position relative to viewport even when user scrolls. Please see sample test.xhtml (attached). What's missing: -ideally there'd be a JS method that would precisely center the dialog (position it) -this method would also have to handle user scrolling a long page (or disable scrollbars) Mircea/Philip: let me know what you think.
          Hide
          dukehoops added a comment -

          example of modal dialog that works w/ long pages, window resizing

          Show
          dukehoops added a comment - example of modal dialog that works w/ long pages, window resizing
          Hide
          dukehoops added a comment -

          Note that in order for this (test.xhtml) to be successfully rendered by icefaces in IE, ice:outputDeclaration doctype declaration has to be added, since icefaces for some reason renders no DOCTYPE by default:

          <ice:outputDeclaration doctypeRoot="html"
          doctypePublic="-//W3C//DTD XHTML 1.0 Strict//EN"
          doctypeSystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />

          Show
          dukehoops added a comment - Note that in order for this (test.xhtml) to be successfully rendered by icefaces in IE, ice:outputDeclaration doctype declaration has to be added, since icefaces for some reason renders no DOCTYPE by default: <ice:outputDeclaration doctypeRoot="html" doctypePublic="-//W3C//DTD XHTML 1.0 Strict//EN" doctypeSystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
          Hide
          dukehoops added a comment -

          Mircea,

          If you're interested in seeing how my above suggestion performs in production, I can get you an account on our website, where this feature is now live. Let me know or ask Philip to do so.

          -nikita

          Show
          dukehoops added a comment - Mircea, If you're interested in seeing how my above suggestion performs in production, I can get you an account on our website, where this feature is now live. Let me know or ask Philip to do so. -nikita
          Hide
          Mircea Toma added a comment -

          Nikita,

          The problem with your fix is that IE6 would not be supported. Also we cannot rely on the document type to fix a layout issue. Please give DR#3 (last developer release) a try and see if things have improved. I'll try to come up with a complete solution in DR#4.

          Show
          Mircea Toma added a comment - Nikita, The problem with your fix is that IE6 would not be supported. Also we cannot rely on the document type to fix a layout issue. Please give DR#3 (last developer release) a try and see if things have improved. I'll try to come up with a complete solution in DR#4.
          Hide
          Mircea Toma added a comment -

          One more thing, we need to use an 'iframe' element for the overlay because 'select' elements are bleeding through any other element type, such as a 'div'. This is in IE6, of course

          Show
          Mircea Toma added a comment - One more thing, we need to use an 'iframe' element for the overlay because 'select' elements are bleeding through any other element type, such as a 'div'. This is in IE6, of course
          Hide
          Philip Breau added a comment -

          This test case shows a modal popup's modal overlay not properly covering all of the the screen. See screenshot.

          Show
          Philip Breau added a comment - This test case shows a modal popup's modal overlay not properly covering all of the the screen. See screenshot.
          Hide
          Philip Breau added a comment -

          shows modal overlay not covering entire screen on Firefox 2.0. Screen was not re-sized.

          Show
          Philip Breau added a comment - shows modal overlay not covering entire screen on Firefox 2.0. Screen was not re-sized.
          Hide
          Mircea Toma added a comment -

          I cannot reproduce the bug. I used Firefox 1.5, 2.0 and IE6.

          Show
          Mircea Toma added a comment - I cannot reproduce the bug. I used Firefox 1.5, 2.0 and IE6.
          Hide
          Ken Fyten added a comment -

          The modal overlay doesn't work if you don't declare a doctype. I tested with both html trans, and xhtml trans, and both work fine, but as soon as you leave off the doctype declaration the overlay only covers a small fraction of the screen.

          Looks like it's not rendering correctly in quirks mode on IE.

          Show
          Ken Fyten added a comment - The modal overlay doesn't work if you don't declare a doctype. I tested with both html trans, and xhtml trans, and both work fine, but as soon as you leave off the doctype declaration the overlay only covers a small fraction of the screen. Looks like it's not rendering correctly in quirks mode on IE.
          Hide
          dukehoops added a comment -

          Still doesn't work with Component Showcase (using Firefox 2.0) demo found here:
          http://component-showcase.icefaces.org/component-showcase/

          If the above runs older source, could you please update the demo so that one can see this component working?

          thanks
          -nikita

          Show
          dukehoops added a comment - Still doesn't work with Component Showcase (using Firefox 2.0) demo found here: http://component-showcase.icefaces.org/component-showcase/ If the above runs older source, could you please update the demo so that one can see this component working? thanks -nikita
          Hide
          Philip Breau added a comment -

          The current demos on www.icefaces.org will remain the current production branch, which is currently 1.5.3. The prebuilt demos are available in the 1.6 download bundles.

          Show
          Philip Breau added a comment - The current demos on www.icefaces.org will remain the current production branch, which is currently 1.5.3. The prebuilt demos are available in the 1.6 download bundles.
          Hide
          Ken Fyten added a comment -

          This fix doesn't work if you don't declare a doctype (use browser quirks mode). Can we make it work in quirks mode also?

          Show
          Ken Fyten added a comment - This fix doesn't work if you don't declare a doctype (use browser quirks mode). Can we make it work in quirks mode also?
          Hide
          Mircea Toma added a comment -

          Choose biggest scroll dimensions of documentElement or body elements.

          Show
          Mircea Toma added a comment - Choose biggest scroll dimensions of documentElement or body elements.

            People

            • Assignee:
              Unassigned
              Reporter:
              Philip Breau
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: