瀏覽代碼

Add name

Add name prop for values to be bound in TextInput component.
tags/0.3.0
TheoryOfNekomata 3 年之前
父節點
當前提交
1ba89be19e
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      packages/react-common/src/components/TextInput/TextInput.tsx

+ 7
- 0
packages/react-common/src/components/TextInput/TextInput.tsx 查看文件

@@ -263,6 +263,10 @@ const propTypes = {
* Value of the component.
*/
value: PropTypes.any,
/**
* Name of the form field associated with this component.
*/
name: PropTypes.string,
}

type Props = PropTypes.InferProps<typeof propTypes>
@@ -291,6 +295,7 @@ const TextInput = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, Props
alternate = false,
defaultValue,
value,
name,
},
ref,
) => (
@@ -333,6 +338,7 @@ const TextInput = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, Props
}}
defaultValue={defaultValue}
value={value}
name={name}
/>
)}
{!multiline && (
@@ -352,6 +358,7 @@ const TextInput = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, Props
}}
defaultValue={defaultValue}
value={value}
name={name}
/>
)}
</CaptureArea>


Loading…
取消
儲存