Skip to content

Commit c36cfaa

Browse files
committed
Fix: Missing button type attributes. Triggers submit when inside the form.
1 parent 7da9a50 commit c36cfaa

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/components/Calendar/Days.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ const Days: React.FC<Props> = ({
190190
<div className="grid grid-cols-7 gap-y-0.5 my-1">
191191
{calendarData.days.previous.map((item, index) => (
192192
<button
193+
type="button"
193194
key={index}
194195
className="flex items-center justify-center text-gray-400 w-full h-12 lg:w-10 lg:h-10"
195196
onClick={() => onClickPreviousDays(item)}
@@ -203,6 +204,7 @@ const Days: React.FC<Props> = ({
203204

204205
{calendarData.days.current.map((item, index) => (
205206
<button
207+
type="button"
206208
key={index}
207209
className={buttonCass(item)}
208210
onClick={() => {
@@ -218,6 +220,7 @@ const Days: React.FC<Props> = ({
218220

219221
{calendarData.days.next.map((item, index) => (
220222
<button
223+
type="button"
221224
key={index}
222225
className="flex items-center justify-center text-gray-400 w-full h-12 lg:w-10 lg:h-10"
223226
onClick={() => {

src/components/Input.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ const Input: React.FC = () => {
159159
/>
160160

161161
<button
162+
type="button"
162163
ref={buttonRef}
163164
className="absolute right-0 h-full px-3 text-gray-400 focus:outline-none"
164165
>

src/components/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ export const RoundedButton: React.FC<Button> = ({
222222
}, [padding, primaryColor, roundedFull]);
223223

224224
return (
225-
<button className={getClassName()} onClick={onClick}>
225+
<button type="button" className={getClassName()} onClick={onClick}>
226226
{children}
227227
</button>
228228
);

0 commit comments

Comments
 (0)