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.

26 lines
635 B

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var dom = require('../../utils/dom.js');
var aria = require('../../utils/aria.js');
const useEscapeKeydown = (handler) => {
const cachedHandler = (e) => {
const event = e;
if (event.key === aria.EVENT_CODE.esc) {
handler == null ? void 0 : handler(event);
}
};
vue.onMounted(() => {
dom.on(document, "keydown", cachedHandler);
});
vue.onBeforeUnmount(() => {
dom.off(document, "keydown", cachedHandler);
});
};
exports.useEscapeKeydown = useEscapeKeydown;
//# sourceMappingURL=index.js.map