mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
option to make textarea input required or optional
This commit is contained in:
parent
af639c7224
commit
3014cf682f
@ -15,6 +15,7 @@ type TextAreaProps = {
|
||||
inputStyle?: string
|
||||
defaultValue: string
|
||||
placeholder?: string
|
||||
required?: boolean
|
||||
updateFormValue?: (value: string) => void
|
||||
}
|
||||
|
||||
@ -30,6 +31,7 @@ export function TextAreaInput({
|
||||
inputStyle,
|
||||
defaultValue,
|
||||
placeholder,
|
||||
required = true,
|
||||
updateFormValue,
|
||||
}: TextAreaProps) {
|
||||
const ref = useRef<HTMLTextAreaElement>(null)
|
||||
@ -90,7 +92,7 @@ export function TextAreaInput({
|
||||
</label>
|
||||
) : null}
|
||||
<textarea
|
||||
required
|
||||
required={required}
|
||||
ref={ref}
|
||||
value={inputValue}
|
||||
name={dataField}
|
||||
|
||||
@ -18,6 +18,7 @@ export const ProfileTextForm = ({
|
||||
heading,
|
||||
size,
|
||||
hideInputLabel,
|
||||
required,
|
||||
}: {
|
||||
state: FormState
|
||||
setState: React.Dispatch<React.SetStateAction<any>>
|
||||
@ -25,6 +26,7 @@ export const ProfileTextForm = ({
|
||||
heading: string
|
||||
size: string
|
||||
hideInputLabel: boolean
|
||||
required?: boolean
|
||||
}) => {
|
||||
const [field, setField] = useState<string>(dataField || 'text')
|
||||
|
||||
@ -57,6 +59,7 @@ export const ProfileTextForm = ({
|
||||
labelStyle={hideInputLabel ? 'tw-hidden' : ''}
|
||||
containerStyle={size === 'full' ? 'tw-grow tw-h-full' : ''}
|
||||
inputStyle={size === 'full' ? 'tw-h-full' : 'tw-h-24'}
|
||||
required={required}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user