label-matches.js 345 B

123456789101112131415
  1. function labelMatches(node, virtualNode) {
  2. if (
  3. virtualNode.props.nodeName !== 'input' ||
  4. virtualNode.hasAttr('type') === false
  5. ) {
  6. return true;
  7. }
  8. var type = virtualNode.attr('type').toLowerCase();
  9. return (
  10. ['hidden', 'image', 'button', 'submit', 'reset'].includes(type) === false
  11. );
  12. }
  13. export default labelMatches;