• Resolved zberno

    (@zberno)


    Hi Jules,
    thanks for your latest update which fixed the SVG problem on IE11.
    As you requested I’m opening a new topic about a similar problem related to IE11.
    The ie console says: `SCRIPT5007: Unable to get property ‘class’ of undefined or null reference
    scripts.js (1118,5)`
    Trying to exclude previous SVG issues I’ve removed all the svgs from my form (directly wrote on the html or injected by some js libs) on development environment but the error persists.
    If you want see it in action please visit: https://app532.apps.aicod.it/azienda/contatti/area-clienti/suggerimenti-e-segnalazioni/
    Thanks a lot!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    I can check after Wednesday. Currently not on a windows machine

    Plugin Author Jules Colle

    (@jules-colle)

    Could you try a manual change at line 1102 scripts_es6.js

    currentNode.dataset.class == 'wpcf7cf_group' ? 'group' :
    to
    currentNode.getAttribute("data-class") == 'wpcf7cf_group' ? 'group' :

    You’ll probably need to translate this to the stranspiled scripts.js file as well:

    So there you would need to find this line:
    var type = currentNode.classList && currentNode.classList.contains('wpcf7cf_repeater') ? 'repeater' : currentNode.dataset["class"] == 'wpcf7cf_group' ? 'group' : currentNode.className == 'wpcf7cf_step' ? 'step' : currentNode.hasAttribute('name') ? 'input' : false;

    and change it to
    var type = currentNode.classList && currentNode.classList.contains('wpcf7cf_repeater') ? 'repeater' : currentNode.getAttribute("data-class") == 'wpcf7cf_group' ? 'group' : currentNode.className == 'wpcf7cf_step' ? 'step' : currentNode.hasAttribute('name') ? 'input' : false;

    Sorry, but I can’t test this myself, because I don’t know the reason for the dataset object to be null sometimes. dataset should be fully supported by IE11 according to https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/dataset

    Thread Starter zberno

    (@zberno)

    Hi Jules,
    thank you for the support.
    I think I found the problem in the theme datepicker (ab-datepicker not the CF7 jqueryUI original one).
    So I think the IE11 dataset object issue is related to a sort of DOM alteration by my datepicker.
    Current status:
    – CF7 conditional fields v1.9.14 (untouched original code);
    – CF7 v5.2.2;
    – Removed custom datepicker;
    – Added CF7 fallback datepicker: add_filter( 'wpcf7_support_html5_fallback', '__return_true' ); in functions.php;
    – Now IE11 does not show errors.

    With this setup:
    – Modern browsers show native datepicker (ok for mobile, not very good for desktops)
    – Browsers with unsupported type=”date” input show jqueryUI datepicker but when date is picked the input shows the date in ISO format (yyyy-mm-dd) (very confusing for users but this is the only configuration for a correct CF7 form validation)

    Thanks for all the support

    • This reply was modified 4 years, 1 month ago by zberno. Reason: wrong snippet code
    • This reply was modified 4 years, 1 month ago by zberno. Reason: clarification
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘javascript error ie11’ is closed to new replies.