mirror of
https://github.com/outline/outline.git
synced 2026-12-06 19:22:29 +03:00
14 lines
331 B
TypeScript
14 lines
331 B
TypeScript
import type { EditorView } from "prosemirror-view";
|
|
|
|
/**
|
|
* Focus the editor if it does not have focus, for controls such as the table
|
|
* grips that stay visible while focus is elsewhere.
|
|
*
|
|
* @param view The editor view.
|
|
*/
|
|
export function focusEditor(view: EditorView): void {
|
|
if (!view.hasFocus()) {
|
|
view.focus();
|
|
}
|
|
}
|