tabindex-evaluate.js 385 B

12345678910
  1. function tabindexEvaluate(node, options, virtualNode) {
  2. const tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
  3. // an invalid tabindex will either return 0 or -1 (based on the element) so
  4. // will never be above 0
  5. // @see https://www.w3.org/TR/html51/editing.html#the-tabindex-attribute
  6. return isNaN(tabIndex) ? true : tabIndex <= 0;
  7. }
  8. export default tabindexEvaluate;