polish/arcana-spells-resize #6

Merged
drew merged 3 commits from polish/arcana-spells-resize into master 2026-06-26 17:54:36 -04:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit e26f135b79 - Show all commits

View File

@@ -192,6 +192,11 @@ function apiURL(path: string) {
return new URL(path, window.location.href).toString();
}
function autoResize(el: HTMLTextAreaElement) {
el.style.height = "auto";
el.style.height = el.scrollHeight + "px";
}
// Copy text to the clipboard. navigator.clipboard is only available in a
// secure context (HTTPS or localhost); over plain HTTP it's undefined, so we
// fall back to the deprecated execCommand("copy"), which still works there.
@@ -1171,6 +1176,8 @@ export default function CharacterSheet() {
<textarea
placeholder="Skill information…"
value={cls.skills || ""}
ref={(el) => { if (el) autoResize(el); }}
onInput={(e) => autoResize(e.currentTarget)}
onChange={(e) =>
setPrimaryClasses((prev) =>
prev.map((c, i) =>
@@ -1345,6 +1352,8 @@ export default function CharacterSheet() {
<textarea
placeholder="Notes / effect description…"
value={s.notes || ""}
ref={(el) => { if (el) autoResize(el); }}
onInput={(e) => autoResize(e.currentTarget)}
onChange={(e) =>
setSpells((prev) =>
prev.map((sp, j) =>

View File

@@ -782,7 +782,8 @@ input[type="number"] {
}
.spell-del-col {
width: 40px;
width: 1px;
white-space: nowrap;
}
.spell-del-btn {