@atlaskit/editor-plugin-media-insert
Version:
Media Insert plugin for @atlaskit/editor-core
17 lines (16 loc) • 488 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useFocusEditor = void 0;
var _react = require("react");
var useFocusEditor = exports.useFocusEditor = function useFocusEditor(_ref) {
var editorView = _ref.editorView;
var focusEditor = (0, _react.useCallback)(function () {
// use setTimeout to run this async after the call
setTimeout(function () {
return editorView.focus();
}, 0);
}, [editorView]);
return focusEditor;
};