Skip to content

Commit

Permalink
fix: 활동보고 기수 숫자만 허용
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 8, 2025
1 parent c70aa43 commit dea439a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export default function CouncilReportEditor({ onCancel, onSubmit, defaultValues
maxWidth="w-[39px]"
placeholder="39"
options={{ required: true }}
type="number"
className="[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
/>{' '}
대 학생회{' '}
<Form.Text
Expand Down
14 changes: 10 additions & 4 deletions components/form/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import clsx from 'clsx';
import { InputHTMLAttributes } from 'react';
import { RegisterOptions, useFormContext } from 'react-hook-form';

Expand All @@ -15,17 +16,22 @@ export default function Text({
textCenter,
name,
options,
className,
...props
}: BasicTextInputProps) {
const { register } = useFormContext();

return (
<input
type="text"
className={`${maxWidth} autofill-bg-white h-8 rounded-sm border border-neutral-300
${bgColor} pl-2 text-sm outline-none placeholder:text-neutral-300 disabled:text-neutral-400 ${
textCenter && 'pr-2 text-center'
}`}
className={clsx(
maxWidth,
'autofill-bg-white h-8 rounded-sm border border-neutral-300',
bgColor,
'pl-2 text-sm outline-none placeholder:text-neutral-300 disabled:text-neutral-400',
textCenter && 'pr-2 text-center',
className,
)}
{...props}
{...register(name, options)}
/>
Expand Down

0 comments on commit dea439a

Please sign in to comment.