Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chrisdunnbirch opened this issue Jun 20, 2016 · 2 comments

Comments

@chrisdunnbirch
Copy link

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');
@aFarkas
Copy link
Owner

aFarkas commented Jun 20, 2016

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
Copy link
Owner

aFarkas commented Jun 20, 2016

Please also note, that webshim is actually deprecated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants