Skip to content

Commit

Permalink
fix(json): cast value
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed Jun 30, 2024
1 parent bfe6f03 commit cb853b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@ function increaseCounter() {

The `session.counter` will show the **last value** and not the **update value**.

This is because the output is **not reactive**. You can use it inside `BindForm` to make it **reactive**.
This is because the output is **not reactive**. You can use it inside `BindForm` to make it **reactive**.
6 changes: 4 additions & 2 deletions packages/forms/src/components-control/input-parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ export function inputReturnValueAttr(astro: AstroGlobal, bind: BindForm<any>) {
return { checked: value ?? astro.props.checked };
case 'file':
return {};
case 'json':
return { type: 'text', min, max };
}

return { value, min, max };
Expand All @@ -194,6 +192,10 @@ export function caseTypes(type: ExtendedInputTypes): { type: ExtendedInputTypes;
pattern: '\\d+',
step: '1'
};
} else if (type == 'json') {
return {
type: 'text'
};
}

return { type };
Expand Down

0 comments on commit cb853b9

Please sign in to comment.