Skip to content

Commit

Permalink
🎨 textarea height
Browse files Browse the repository at this point in the history
  • Loading branch information
frostime committed May 10, 2024
1 parent a5e0310 commit 6cd69c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sy-docs-flow",
"version": "0.7.2",
"version": "0.7.3",
"type": "module",
"description": "",
"repository": "",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sy-docs-flow",
"author": "frostime",
"url": "https://github.com/frostime/sy-docs-flow",
"version": "0.7.2",
"version": "0.7.3",
"minAppVersion": "3.0.0",
"backends": ["all"],
"frontends": ["desktop", "desktop-window", "browser-desktop", "browser-mobile"],
Expand Down
6 changes: 4 additions & 2 deletions src/components/docs-flow/docs-flow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Author : Yp Z
Date : 2023-07-28 20:49:27
FilePath : /src/components/docs-flow/docs-flow.svelte
LastEditTime : 2024-05-09 21:10:50
LastEditTime : 2024-05-10 14:12:47
Description :
-->
<script lang="ts">
Expand Down Expand Up @@ -246,9 +246,11 @@
textarea.value = inputText;
textarea.className = "b3-text-field fn__block";
textarea.placeholder = hint;
let lineCnt = inputText.split("\n").length;
lineCnt = Math.min(Math.max(lineCnt, 2), 10) + 1;
Object.assign(textarea.style, {
resize: "vertical",
height: "5em",
height: `${lineCnt * 20}px`,
whiteSpace: "nowrap",
fontFamily: "var(--b3-font-family-code)"
});
Expand Down

0 comments on commit 6cd69c0

Please sign in to comment.