Skip to content

Commit

Permalink
Fix: Returned values (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Oct 31, 2023
1 parent cd5a073 commit 77782ca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-weeks-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"formsnap": patch
---

Fix: Returned values
5 changes: 3 additions & 2 deletions src/lib/components/form-checkbox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import type { CheckboxProps } from "../types.js";
type $$Props = CheckboxProps;
const { actions, errors } = getFormField();
const { actions, errors, attrStore } = getFormField();
$: attrs = {
"data-fs-checkbox": "",
"data-fs-error": $errors ? "" : undefined
"data-fs-error": $errors ? "" : undefined,
...$attrStore
};
</script>

Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/form-input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import type { InputProps } from "../types.js";
type $$Props = InputProps;
const { actions, errors } = getFormField();
const { actions, errors, attrStore } = getFormField();
$: attrs = {
"data-fs-input": "",
"data-fs-error": $errors ? "" : undefined
"data-fs-select": "",
"data-fs-error": $errors ? "" : undefined,
...$attrStore
};
</script>

Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/form-radio.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import type { RadioProps } from "../types.js";
type $$Props = RadioProps;
const { actions, errors, } = getFormField();
const { actions, errors, attrStore } = getFormField();
$: attrs = {
"data-fs-radio": "",
"data-fs-error": $errors ? "" : undefined
"data-fs-select": "",
"data-fs-error": $errors ? "" : undefined,
...$attrStore
};
</script>

Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/form-select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import type { SelectProps } from "../types.js";
type $$Props = SelectProps;
const { actions, errors } = getFormField();
const { actions, errors, attrStore } = getFormField();
$: attrs = {
"data-fs-select": "",
"data-fs-error": $errors ? "" : undefined
"data-fs-error": $errors ? "" : undefined,
...$attrStore
};
</script>

Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/form-textarea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import type { TextareaProps } from "../types.js";
type $$Props = TextareaProps;
const { actions, errors } = getFormField();
const { actions, errors, attrStore } = getFormField();
$: attrs = {
"data-fs-textarea": "",
"data-fs-error": $errors ? "" : undefined
"data-fs-select": "",
"data-fs-error": $errors ? "" : undefined,
...$attrStore
};
</script>

Expand Down

0 comments on commit 77782ca

Please sign in to comment.