FIX: More fixes to the cell editor

* Font family is Inter, font size 13, line-width 22
* Correct vertical align for multiline text
* Entering multiline text sets the height of the row (!)
This commit is contained in:
Nicolás Hatcher
2024-10-12 23:57:48 +02:00
committed by Nicolás Hatcher Andrés
parent 585e594d8d
commit 9a46e5ccc7
4 changed files with 40 additions and 20 deletions

View File

@@ -95,13 +95,11 @@ const Editor = (options: EditorOptions) => {
const { onKeyDown } = useKeyDown({
model,
text,
onEditEnd,
onTextUpdated,
workbookState,
textareaRef,
setStyledFormula,
setText,
});
useEffect(() => {
@@ -124,6 +122,10 @@ const Editor = (options: EditorOptions) => {
if (scrollWidth > editorWidth - 5) {
cell.editorWidth = scrollWidth + 10;
}
const scrollHeight = formulaRef.current.scrollHeight;
if (scrollHeight > editorHeight) {
cell.editorHeight = scrollHeight;
}
}
}, [text, workbookState]);
@@ -203,6 +205,8 @@ const Editor = (options: EditorOptions) => {
overflow: "hidden",
display: showEditor,
background: "#FFF",
fontFamily: "Inter",
fontSize: "13px"
}}
>
<div