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(pro:search): select panel virtual not working #1501
Conversation
fix(pro:search): remove unused select field option
This preview will be available after the AzureCI is passed. |
@@ -100,7 +100,6 @@ SelectSearchFieldConfig | |||
| `separator` | 多选分隔符 | `string` | `'|'` | - | - | | |||
| `showSelectAll` | 是否支持全选 | `boolean` | `true` | - | - | | |||
| `virtual` | 是否支持虚拟滚动 | `boolean` | `false` | - | 默认不支持 | | |||
| `overlayItemWidth` | 选项宽度 | `number` | - | - | - | | |||
| `onSearch` | 搜索回调函数 | `(searchValue: string) => void | ((searchValue: string) => void)[]` | - | - | 在触发搜索值改变时执行 | | |||
|
|||
> 注:使用 `Ctrl + Enter` 在多选下切换面板中选项选中状态 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code review
-
The
separator
andshowSelectAll
properties of the SelectSearchFieldConfig are not necessary to be passed as parameters, as they have default values already. -
The
overlayItemWidth
property is not required as it is optional. -
The
onSearch
property should have a more descriptive name, such asonSearchValueChange
, as it is used to indicate when the search value has changed. -
The comment at the end should be more descriptive, such as 'Use Ctrl+Enter to toggle the selection of items in the multi-select panel'
@@ -153,6 +153,7 @@ export default defineComponent({ | |||
getKey: 'key', | |||
labelKey: 'label', | |||
selectedKeys: props.value, | |||
virtual: props.virtual, | |||
onOptionClick: handleOptionClick, | |||
'onUpdate:activeValue': setActiveValue, | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review:
The code looks good and seems to be doing what it is supposed to do. There are no obvious bugs or potential risks that I can see. However I would suggest adding some comments to the code to help explain why the line was added and what it does. This will make it easier for you or anyone else to go back and understand the code at a later stage.
@@ -42,7 +42,6 @@ export interface SelectSearchField extends SearchFieldBase<VKey | VKey[]> { | |||
virtual?: boolean | |||
searchFn?: (data: SelectPanelData, searchText?: string) => boolean | |||
onSearch?: MaybeArray<(searchValue: string) => void> | |||
overlayItemWidth?: number | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with reviewing the code patch
The code patch looks good to me overall. The only issue I can see is the removal of the "overlayItemWidth" property. This may have an impact on the user experience if it is used in a specific context. I would suggest adding this back in or replacing it with an alternative that provides a similar function. Additionally, I would suggest adding some comments to explain why the changes were made and how they are beneficial.
Codecov Report
@@ Coverage Diff @@
## main #1501 +/- ##
==========================================
+ Coverage 92.73% 92.75% +0.01%
==========================================
Files 331 331
Lines 30752 30801 +49
Branches 3533 3533
==========================================
+ Hits 28519 28568 +49
Misses 2233 2233
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
fix(pro:search): remove unused select field option
PR Checklist
Please check if your PR fulfills the following requirements:
What is the current behavior?
高级搜索的selectField, 虚拟滚动不生效
What is the new behavior?
修复以上问题
去掉未使用的 overlayItemWidth 配置(下个feature版本用overlayClassName统一解决)
Other information