decent progress
This commit is contained in:
parent
e901fc3f76
commit
a9ae4f9888
14 changed files with 318 additions and 162 deletions
|
|
@ -33,13 +33,13 @@ export function setRightMostCaretPosition(elem) {
|
|||
}
|
||||
|
||||
export function focusNextElement() {
|
||||
const editable = Array.from<any>(document.querySelectorAll('[contenteditable]'));
|
||||
const editable = Array.from<any>(document.querySelectorAll('input'));
|
||||
const index = editable.indexOf(document.activeElement);
|
||||
editable[index+1]?.focus();
|
||||
}
|
||||
|
||||
export function focusPrevElement() {
|
||||
const editable = Array.from<any>(document.querySelectorAll('[contenteditable]'));
|
||||
const editable = Array.from<any>(document.querySelectorAll('input'));
|
||||
const index = editable.indexOf(document.activeElement);
|
||||
const prevElem = editable[index-1]
|
||||
if (prevElem) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import type { EditorState } from "../Editor";
|
||||
|
||||
export interface Dynamic {
|
||||
i: any;
|
||||
t: any;
|
||||
|
|
@ -6,5 +8,6 @@ export interface Dynamic {
|
|||
export interface State2Props<T> {
|
||||
state: T;
|
||||
// setState: (callback: (state: T) => T) => void;
|
||||
setState: (state: T) => void;
|
||||
// setState: (state: T) => void;
|
||||
setState: (state: EditorState) => void;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue