Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(input): textarea height cannot respond to autosize option changes #6654

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## NEXT_VERSION

### Fixes

- Fix `n-input` when the type is `textarea` the height cannot respond to `autosize` option changes.

## 2.40.3

`2024-12-02`
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- 修复 `n-scrollbar``n-float-button``n-float-button-group``n-popover` 组件中的 `inset` 属性在部分浏览器中有兼容性问题,close [#6604](https://github.com/tusen-ai/naive-ui/issues/6604),close [#6602](https://github.com/tusen-ai/naive-ui/issues/6602)
- 修复 `n-input` 组件 `type``textarea`的时候,`autosize` 配置发生变化,高度却没有改变

## 2.40.3

Expand Down
3 changes: 3 additions & 0 deletions src/input/src/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ export default defineComponent({
}
}
}
const autoSizeOptionNeedWatch = typeof props.autosize !== 'boolean'
if (autoSizeOptionNeedWatch)
watch(toRef(props, 'autosize'), () => updateTextAreaStyle())
// word count
const maxlengthRef = computed(() => {
const { maxlength } = props
Expand Down