Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-690

HTML5 Print handler for IE does not accurately print form element values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.2, 1.5.0
    • Fix Version/s: 1.5.1, 1.6.0, 1.5.3
    • Component/s: Node
    • Labels:
      None

      Description

      Our print handler for HTML5 in IE < 8 currently has a bug where it will always print out the default values for certain form fields, such as selects, checkboxes and radio buttons.

      The reason for this is because we currently use cloneNode(true) on the body element right before we print. cloneNode causes the elements to revert to their default state in IE when grabbing the innerHTML. If we were to just use the innerHTML of the original body, it would work fine, but we have to use cloneNode because there is an IE bug where if you try to print a page with an iframe and grabbing the innerHTML, it will show the iframe as empty. Getting the innerHTML of a cloned body however points it to the right URL (I'm guessing it grabs the default value like the form nodes do).

      In order to fix this, the only way I can think of is to grab all of the elements of both nodes and loop through the elements in the clone.
      I check if the node is an option or an input with type checkbox or type radio, and if it is, I update the nodes value to that of element in the original.
      Since we're using live node lists, it's entirely possible that one of the lists could fall out of sync during the execution, but this seems pretty unlikely (famous last words).

        Attachments

          Activity

            People

            Assignee:
            nathan.cavanaugh Nate Cavanaugh
            Reporter:
            nathan.cavanaugh Nate Cavanaugh
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              9 years, 8 weeks ago

                Packages

                Version Package
                1.5.1
                1.6.0
                1.5.3