From c9eb9924effd45947ab7a3af5a4fd9f9cd2fc36d Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Fri, 2 Aug 2024 11:15:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(input):=20MockInput=20=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E5=88=B0=E5=80=BC=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=20value=20=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/five-mails-beg.md | 2 +- .changeset/plenty-mice-thank.md | 5 +++++ .changeset/red-gorillas-count.md | 5 +++++ .changeset/selfish-steaks-think.md | 5 +++++ packages/ui/input/src/MockInput.tsx | 2 +- packages/ui/select/src/Select.tsx | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .changeset/plenty-mice-thank.md create mode 100644 .changeset/red-gorillas-count.md create mode 100644 .changeset/selfish-steaks-think.md diff --git a/.changeset/five-mails-beg.md b/.changeset/five-mails-beg.md index dec8fc461..439be6116 100644 --- a/.changeset/five-mails-beg.md +++ b/.changeset/five-mails-beg.md @@ -2,4 +2,4 @@ "@hi-ui/notification": patch --- -调整通知组件过度样式触发滚动条 +fix: 调整通知组件过度样式触发滚动条 diff --git a/.changeset/plenty-mice-thank.md b/.changeset/plenty-mice-thank.md new file mode 100644 index 000000000..ccbbed1f8 --- /dev/null +++ b/.changeset/plenty-mice-thank.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/input": minor +--- + +feat: MockInput 没有匹配到值时默认展示 value 值 diff --git a/.changeset/red-gorillas-count.md b/.changeset/red-gorillas-count.md new file mode 100644 index 000000000..66ca1df9d --- /dev/null +++ b/.changeset/red-gorillas-count.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(input): MockInput 没有匹配到值时默认展示 value 值 diff --git a/.changeset/selfish-steaks-think.md b/.changeset/selfish-steaks-think.md new file mode 100644 index 000000000..1b95eae8e --- /dev/null +++ b/.changeset/selfish-steaks-think.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(notification): 调整通知组件过度样式触发滚动条 diff --git a/packages/ui/input/src/MockInput.tsx b/packages/ui/input/src/MockInput.tsx index 759ebc820..2a40254ea 100644 --- a/packages/ui/input/src/MockInput.tsx +++ b/packages/ui/input/src/MockInput.tsx @@ -48,7 +48,7 @@ export const MockInput = forwardRef( const displayItem = useMemo(() => { if (value === '') return null - const displayItem = data.find((item) => item.id === value) + const displayItem = data.find((item) => item.id === value) || { id: value, title: value } return displayItem || null }, [value, data]) diff --git a/packages/ui/select/src/Select.tsx b/packages/ui/select/src/Select.tsx index 1183c5a28..dec864c72 100644 --- a/packages/ui/select/src/Select.tsx +++ b/packages/ui/select/src/Select.tsx @@ -84,7 +84,7 @@ export const Select = forwardRef( ref ) => { const i18n = useLocaleContext() - const innerRef = useRef() + const innerRef = useRef(null) const placeholder = isUndef(placeholderProp) ? i18n.get('select.placeholder') : placeholderProp const [menuVisible, menuVisibleAction] = useUncontrolledToggle({