implicit-evaluate.js 410 B

12345678910111213141516
  1. import { closest } from '../../core/utils';
  2. import { accessibleTextVirtual } from '../../commons/text';
  3. function implicitEvaluate(node, options, virtualNode) {
  4. try {
  5. const label = closest(virtualNode, 'label');
  6. if (label) {
  7. return !!accessibleTextVirtual(label, { inControlContext: true });
  8. }
  9. return false;
  10. } catch (e) {
  11. return undefined;
  12. }
  13. }
  14. export default implicitEvaluate;