From 0d27acc649d3be36c71e418dc8e5cc90baf3bf17 Mon Sep 17 00:00:00 2001 From: 07akioni <07akioni2@gmail.com> Date: Sat, 12 Nov 2022 18:57:28 +0800 Subject: [PATCH] fix(input): `autosize` prop doesn't work properly if there are multiple spaces, closes #4027 --- CHANGELOG.en-US.md | 1 + CHANGELOG.zh-CN.md | 1 + src/input/src/styles/input.cssr.ts | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 157d96bffdf..9470962da1a 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -39,6 +39,7 @@ - Fix `n-timeline-item`'s `line-type="dashed"` not working when `n-timeline`'s `horizontal` is set, closes [#4014](https://github.com/tusen-ai/naive-ui/issues/4014). - Fix `n-popover` doesn't wrap line if word is too long. - Fix `n-date-picker` can't delete all input content in some cases, closes [#3922](https://github.com/tusen-ai/naive-ui/issues/3922). +- Fix `n-input`'s `autosize` prop doesn't work properly if there are multiple spaces, closes [#4027](https://github.com/tusen-ai/naive-ui/issues/4027). ### i18n diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 40bc71bf008..17d51da5274 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -38,6 +38,7 @@ - 修复 `n-ellipsis` 在 `n-card` 标题中使用不会溢出,关闭 [#3935](https://github.com/tusen-ai/naive-ui/issues/3935) - 修复 `n-timeline-item` 在 `n-timeline` 设定 `horizontal` 之后,`line-type="dashed"` 不生效,关闭 [#4014](https://github.com/tusen-ai/naive-ui/issues/4014) - 修复 `n-popover` 在英文和数字过长时不断行 +- 修复 `n-input` 的属性 `autosize` 在输入包含多个空格的时候表现不正确,关闭 [#4027](https://github.com/tusen-ai/naive-ui/issues/4027) ### i18n diff --git a/src/input/src/styles/input.cssr.ts b/src/input/src/styles/input.cssr.ts index df08379658a..8999ae6ba79 100644 --- a/src/input/src/styles/input.cssr.ts +++ b/src/input/src/styles/input.cssr.ts @@ -139,7 +139,7 @@ export default cB('input', ` overflow: hidden; visibility: hidden; position: static; - white-space: nowrap; + white-space: pre; pointer-events: none; `), cE('input-el', `