Skip to content

Commit

Permalink
edit useTextField prop, test
Browse files Browse the repository at this point in the history
  • Loading branch information
junghyeonsu committed Jun 28, 2024
1 parent 9b7fa64 commit c092b42
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions packages/react-headless/text-field/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,13 @@ export function useTextField(props: UseTextFieldProps) {
autoComplete,
autoFocus,
allowExceedLength,
defaultValue,
minLength,
maxLength,
placeholder,
inputMode,
name,
onBlur,
onFocus,
type = "text",
...restProps
} = props;

const {
Expand Down Expand Up @@ -151,7 +148,6 @@ export function useTextField(props: UseTextFieldProps) {
setIsFocused,
setIsFocusVisible,

restProps,
stateProps,

rootProps: elementProps({
Expand Down Expand Up @@ -183,7 +179,6 @@ export function useTextField(props: UseTextFieldProps) {
"aria-required": ariaAttr(required),
"aria-invalid": ariaAttr(invalid),
"aria-autocomplete": autoComplete,
defaultValue,
autoFocus,
onChange: (e) => {
const givenValue = e.target.value;
Expand Down
3 changes: 1 addition & 2 deletions packages/react-headless/text-field/src/useTextField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function TextField(props: UseTextFieldProps) {
descriptionProps,
errorMessageProps,
stateProps,
restProps,
graphemes,
} = useTextField({ ...props, elementType: "input" });

Expand All @@ -37,7 +36,7 @@ function TextField(props: UseTextFieldProps) {
</div>
<div data-part="field">
<div data-part="prefix" />
<input {...inputProps} {...restProps} />
<input {...inputProps} />
<div data-part="suffix" />
</div>
<div data-part="foot">
Expand Down

0 comments on commit c092b42

Please sign in to comment.