Skip to content

Commit

Permalink
Add name attr to Input and Textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Jul 18, 2024
1 parent d65280f commit 9322159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { forwardRef } from 'react'
import { InputProps as IP } from 'types'
import { getMarginProps, omitMarginProps } from '../utils'
import ErrorMessage from './ErrorMessage'
import Box from './Box'
import ErrorMessage from './ErrorMessage'
import Text from './Text'

export interface InputProps extends IP {
Expand All @@ -24,6 +24,7 @@ const Input = forwardRef(({ error, name, label, ...rest }: InputProps, ref) => {
type="text"
tx="forms"
id={name}
name={name}
variant={error ? 'errorInput' : 'forms.input'}
{...omitMarginProps(rest)}
__css={{
Expand Down
4 changes: 3 additions & 1 deletion src/components/Textarea.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { ReactElement, forwardRef } from 'react'
import { TextareaProps as TP } from 'types'
import { getMarginProps, omitMarginProps } from '../utils'
import ErrorMessage from './ErrorMessage'
import Box from './Box'
import ErrorMessage from './ErrorMessage'
import Text from './Text'

export interface TextareaProps extends TP {
Expand Down Expand Up @@ -30,6 +30,8 @@ const Textarea = forwardRef(
ref={ref}
as="textarea"
tx="forms"
name={name}
id={name}
variant={error ? 'errorTextarea' : 'textarea'}
{...omitMarginProps(rest)}
__css={{
Expand Down

0 comments on commit 9322159

Please sign in to comment.