Skip to content

Commit

Permalink
refactor: bump rc-input to v1.4.0 (#52)
Browse files Browse the repository at this point in the history
* refactor: bump rc-input to v1.4.0

* chore: update snapshot

* chore: code clean
  • Loading branch information
MadCcc authored Dec 14, 2023
1 parent 6447174 commit 9756304
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"dependencies": {
"@babel/runtime": "^7.10.1",
"classnames": "^2.2.1",
"rc-input": "~1.3.5",
"rc-input": "~1.4.0",
"rc-resize-observer": "^1.0.0",
"rc-util": "^5.27.0"
},
Expand Down
43 changes: 20 additions & 23 deletions src/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ const TextArea = React.forwardRef<TextAreaRef, TextAreaProps>(

const isPureTextArea = !rest.autoSize && !showCount && !allowClear;

const textarea = (
return (
<BaseInput
value={formatValue}
allowClear={allowClear}
handleReset={handleReset}
suffix={suffixNode}
prefixCls={prefixCls}
classes={{
classNames={{
affixWrapper: clsx(classes?.affixWrapper, {
[`${prefixCls}-show-count`]: showCount,
[`${prefixCls}-textarea-allow-clear`]: allowClear,
Expand All @@ -232,28 +232,25 @@ const TextArea = React.forwardRef<TextAreaRef, TextAreaProps>(
},
}}
hidden={hidden}
inputElement={
<ResizableTextArea
{...rest}
maxLength={maxLength}
onKeyDown={handleKeyDown}
onChange={onInternalChange}
onFocus={handleFocus}
onBlur={handleBlur}
onCompositionStart={onInternalCompositionStart}
onCompositionEnd={onInternalCompositionEnd}
className={clsx(classNames?.textarea)}
style={{ ...styles?.textarea, resize: style?.resize }}
disabled={disabled}
prefixCls={prefixCls}
onResize={handleResize}
ref={resizableTextAreaRef}
/>
}
/>
>
<ResizableTextArea
{...rest}
maxLength={maxLength}
onKeyDown={handleKeyDown}
onChange={onInternalChange}
onFocus={handleFocus}
onBlur={handleBlur}
onCompositionStart={onInternalCompositionStart}
onCompositionEnd={onInternalCompositionEnd}
className={clsx(classNames?.textarea)}
style={{ ...styles?.textarea, resize: style?.resize }}
disabled={disabled}
prefixCls={prefixCls}
onResize={handleResize}
ref={resizableTextAreaRef}
/>
</BaseInput>
);

return textarea;
},
);

Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/index.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`TextArea classNames and styles should work 1`] = `
style="color: red; background: red;"
/>
<span
class="rc-textarea-affix-wrapper custom-class rc-textarea-show-count"
class="rc-textarea-affix-wrapper rc-textarea-show-count custom-class"
data-count="0"
style="background: red;"
>
Expand Down

0 comments on commit 9756304

Please sign in to comment.