web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
387 B

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.focus = focus;
  6. var _utils = require("./utils");
  7. function focus(element) {
  8. if (!(0, _utils.isFocusable)(element)) return;
  9. const isAlreadyActive = (0, _utils.getActiveElement)(element.ownerDocument) === element;
  10. if (isAlreadyActive) return;
  11. (0, _utils.eventWrapper)(() => element.focus());
  12. }