Skip to content

Commit

Permalink
Merge branch 'bug/textarea_enter_of_lastone'
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGB committed May 1, 2024
2 parents 3ce4654 + 7ef63e2 commit d46847f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
14 changes: 7 additions & 7 deletions WorkFlow Test/Workflow of new notes.canvas

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "zettelflow",
"name": "ZettelFlow",
"version": "2.3.2",
"version": "2.3.3",
"minAppVersion": "1.4.11",
"description": "Helps you to create and manage your notes in a Zettelkasten way via Canvas.",
"author": "RafaelGB",
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zettelflow",
"version": "2.3.2",
"version": "2.3.3",
"description": "A plugin for Obsidian that allows you to create and manage notes in a ZettelFlow-like way.",
"main": "main.js",
"scripts": {
Expand All @@ -25,7 +25,7 @@
"codemirror": "6.0.1",
"esbuild": "0.20.2",
"esbuild-sass-plugin": "3.2.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "7.34.1",
"jest": "29.7.0",
"obsidian": "1.5.7-1",
Expand Down
2 changes: 2 additions & 0 deletions src/actions/number/NumberComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function NumberWrapper(props: WrappedActionBuilderProps) {
type="number"
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
e.stopPropagation();
callback(parseFloat(e.currentTarget.value));
}
}}
Expand Down
6 changes: 4 additions & 2 deletions src/actions/prompt/PromptComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export function PromptWrapper(props: WrappedActionBuilderProps) {
placeholder={
TypeService.isString(action.placeholder) ? action.placeholder : ""
}
onKeyDown={(key, value) => {
if (key === "Enter") {
onKeyDown={(event, value) => {
if (event.key === "Enter") {
event.preventDefault();
event.stopPropagation();
callback(value);
}
}}
Expand Down
2 changes: 1 addition & 1 deletion src/architecture/components/core/input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function TextArea(info: InputType) {
}}
onKeyDown={(event) => {
if (onKeyDown) {
onKeyDown(event.key, valueState || "");
onKeyDown(event, valueState || "");
}
}}
autoFocus={autofocus}
Expand Down
2 changes: 1 addition & 1 deletion src/architecture/components/core/input/typing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export type InputType = {
value?: string,
required?: boolean,
onChange?: (value: string) => void
onKeyDown?: (key: string, currentValue: string) => void
onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>, currentValue: string) => void
}

0 comments on commit d46847f

Please sign in to comment.