decent progress

This commit is contained in:
Joeri Exelmans 2025-05-11 22:54:23 +02:00
parent e901fc3f76
commit a9ae4f9888
14 changed files with 318 additions and 162 deletions

View file

@ -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) {

View file

@ -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;
}