webshim icon indicating copy to clipboard operation
webshim copied to clipboard

forms-ext limited to "types: 'number'" but is still polyfilling date inputs in Chrome

Open chrisdunnbirch opened this issue 9 years ago • 2 comments
trafficstars

I'm currently having a strange issue whereby telling 'forms-ext' which types to polyfills appears to only be understood in Firefox.

I have a page with an <input type="date"> element which is being replaced with a jQueryUI Datepicker, obviously the input itself is hidden and the jQueryUI Datepicker elements are styled and visible.

I've tested this page in Safari, Opera, Chrome, Firefox and IE across OS X El Capitan and Windows 7 & 10. Firefox appears as desired, with the <input type="date"> element being ignored by webshim as per the code below. However all other browsers show a webshim <input type="text"> with associated webshim datepicker <span class="input-buttons date-input-buttons">. I'm really struggling to figure out whether this is something I've done incorrectly with the webshim configuration or whether this is a bug with webshim itself.

Here is an image of the result on Gyazo.

Below is the code, as you can see I only want forms-ext to polyfill <input type="number">:

webshim.setOptions({
    'debug': true,
    'forms': {
        replaceValidationUI: true,
        lazyCustomMessages: true,
        iVal: {
            fieldWrapper: '.form_fields__field',
            errorWrapperClass: 'form_fields__field--has_warning',
            errorBoxClass: 'form_fields__field_warning'
        },
        addValidators: true
    },
    'forms-ext': {
        replaceUI: 'auto',
        types: 'number'
    }
});

webshim.polyfill('forms forms-ext');

chrisdunnbirch avatar Jun 20 '16 16:06 chrisdunnbirch

webshim.setOptions({
    'debug': true,
    'forms': {
        replaceValidationUI: true,
        lazyCustomMessages: true,
        iVal: {
            fieldWrapper: '.form_fields__field',
            errorWrapperClass: 'form_fields__field--has_warning',
            errorBoxClass: 'form_fields__field_warning'
        },
        addValidators: true
    },
    'forms-ext': {
        replaceUI: {number: 'auto'},
        types: 'number'
    }
});

aFarkas avatar Jun 20 '16 16:06 aFarkas

Please also note, that webshim is actually deprecated.

aFarkas avatar Jun 20 '16 16:06 aFarkas