Skip to content

Commit

Permalink
fix(textarea): name
Browse files Browse the repository at this point in the history
  • Loading branch information
ido-pluto committed May 7, 2024
1 parent 6f3de1c commit 0991b16
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/forms/src/components/form/BInput.astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const inputValue = inputReturnValueAttr(Astro, bind);
const allProps = { ...props, ...inputValue, ...componentProps, pattern: pattern?.toString(), ...castProps };
allProps.name = bindCounter + allProps.name;
addOnSubmitClickEvent(onSubmitClick, allProps);
webFormsSettings.haveFileUpload ||= allProps.type === 'file';
const Component = asComponent as any;
Expand Down
1 change: 1 addition & 0 deletions packages/forms/src/components/form/BSelect.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface Props<T extends keyof JSX.IntrinsicElements | React.JSXElementC
const { bind, method, onSubmitClickGlobal, bindCounter = '' } = getContext(Astro, '@astro-utils/forms');
const { as: asComponent = 'select', value: _, props: componentProps, onSubmitClick = onSubmitClickGlobal, ...props } = Astro.props;
props.name = bindCounter + props.name;
addOnSubmitClickEvent(onSubmitClick, props);
let stringifySelectdOptions = getSelectValueFromBind(bind, Astro);
Expand Down
1 change: 1 addition & 0 deletions packages/forms/src/components/form/BTextarea.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ if (!Astro.props.disabled && method === 'POST' && await validateFrom(Astro)) {
}
const {as: asComponent = 'textarea', props: componentProps, value: defaultValue, onSubmitClick = onSubmitClickGlobal, ...props} = Astro.props;
props.name = bindCounter + props.name;
addOnSubmitClickEvent(onSubmitClick, props);
const value = getProperty(bind, Astro.props.name, await Astro.slots.render('default') ?? defaultValue);
Expand Down

0 comments on commit 0991b16

Please sign in to comment.