fix(select): onBlur function data of the select component is wrong (#2281)

* fix(select): onBlur function data of the select component is wrong

BREAKING CHANGE: change ts interface

fix #2271

* fix(select): onBlur context params

---------

Co-authored-by: Ali <ali.wu@miotech.com>
Co-authored-by: Uyarn <uyarnchen@gmail.com>
This commit is contained in:
ZhuoYang Wu(阿离) 2023-06-13 16:19:11 +08:00 committed by GitHub
parent 3c4bb29b2e
commit f311a3345b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

3
.gitignore vendored
View File

@ -24,4 +24,5 @@ robotMsg.json
.nyc_output
cypress-coverage
instrumented
cy-report
cy-report
.history

View File

@ -434,7 +434,9 @@ const Select = forwardRefWithStatics(
onInputChange={handleInputChange}
onFocus={onFocus}
onEnter={handleEnter}
onBlur={onBlur}
onBlur={(_, context) => {
onBlur?.({ value, e: context.e as React.FocusEvent<HTMLDivElement> });
}}
onClear={(context) => {
onClearValue(context);
}}

View File

@ -93,4 +93,4 @@ bufferSize | Number | 20 | \- | N
isFixedRowHeight | Boolean | false | \- | N
rowHeight | Number | - | \- | N
threshold | Number | 100 | \- | N
type | String | - | required。options:lazy/virtual | Y
type | String | - | required。options:lazy/virtual | Y

View File

@ -93,4 +93,4 @@ bufferSize | Number | 20 | 表示除可视区域外,额外渲染的行数,
isFixedRowHeight | Boolean | false | 表示每行内容是否同一个固定高度,仅在 `scroll.type``virtual` 时有效,该属性设置为 `true` 时,可用于简化虚拟滚动内部计算逻辑,提升性能,此时则需要明确指定 `scroll.rowHeight` 属性的值 | N
rowHeight | Number | - | 行高,不会给`<tr>`元素添加样式高度,仅作为滚动时的行高参考。一般情况不需要设置该属性。如果设置,可尽量将该属性设置为每行平均高度,从而使得滚动过程更加平滑 | N
threshold | Number | 100 | 启动虚拟滚动的阈值。为保证组件收益最大化,当数据量小于阈值 `scroll.threshold` 时,无论虚拟滚动的配置是否存在,组件内部都不会开启虚拟滚动 | N
type | String | - | 必需。滚动加载类型,有两种:懒加载和虚拟滚动。<br />值为 `lazy` ,表示滚动时会进行懒加载,非可视区域内的内容将不会默认渲染,直到该内容可见时,才会进行渲染,并且已渲染的内容滚动到不可见时,不会被销毁;<br />值为`virtual`时,表示会进行虚拟滚动,无论滚动条滚动到哪个位置,同一时刻,仅渲染该可视区域内的内容,当需要展示的数据量较大时,建议开启该特性。可选项:lazy/virtual | Y
type | String | - | 必需。滚动加载类型,有两种:懒加载和虚拟滚动。<br />值为 `lazy` ,表示滚动时会进行懒加载,非可视区域内的内容将不会默认渲染,直到该内容可见时,才会进行渲染,并且已渲染的内容滚动到不可见时,不会被销毁;<br />值为`virtual`时,表示会进行虚拟滚动,无论滚动条滚动到哪个位置,同一时刻,仅渲染该可视区域内的内容,当需要展示的数据量较大时,建议开启该特性。可选项:lazy/virtual | Y