How to use the modernizr.inputtypes function in modernizr

To help you get started, we’ve selected a few modernizr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github silverstripe / silverstripe-admin / client / src / legacy / DatetimeField.js View on Github external
onadd() {
      // Browser supports type=date natively
      if (modernizr.inputtypes['datetime-local']) {
        return;
      }

      // disabled, readonly or already applied
      if (this.prop('disabled') || this.prop('readonly') || this.hasClass('hasDatepicker')) {
        return;
      }

      // Duplicate input field to store ISO value
      const hiddenInput = $(
        '<input>',
        { type: 'hidden', name: this.attr('name'), value: this.val() }
      );
      this.parent().append(hiddenInput);

      // Avoid original field being saved
github silverstripe / silverstripe-admin / client / src / legacy / DateField.js View on Github external
onadd() {
      // Browser supports type=date natively
      if (modernizr.inputtypes.date) {
        return;
      }

      // disabled, readonly or already applied
      if (this.prop('disabled') || this.prop('readonly') || this.hasClass('hasDatepicker')) {
        return;
      }

      // Duplicate input field to store ISO value
      const hiddenInput = $(
        '<input>',
        { type: 'hidden', name: this.attr('name'), value: this.val() }
      );
      this.parent().append(hiddenInput);

      // Avoid original field being saved