Sha256: 11634a31fe2405f8fad915ef154b5b60188180af05a4bf322e3a2f3eddac302e

Contents?: true

Size: 405 Bytes

Versions: 3

Compression:

Stored size: 405 Bytes

Contents

const FORM_CONTROL_TAGS = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'];

/**
  @private
  @param {Element} element the element to check
  @returns {boolean} `true` when the element is a form control, `false` otherwise
*/
export default function isFormControl(element) {
  let { tagName, type } = element;

  if (type === 'hidden') {
    return false;
  }

  return FORM_CONTROL_TAGS.indexOf(tagName) > -1;
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/ember-testing/lib/helpers/-is-form-control.js
discourse-ember-source-3.5.1.1 dist/es/ember-testing/lib/helpers/-is-form-control.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-testing/lib/helpers/-is-form-control.js