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(pro:search): select panel virtual not working #1501

Merged
merged 1 commit into from Mar 13, 2023

Conversation

sallerli1
Copy link
Contributor

fix(pro:search): remove unused select field option

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

高级搜索的selectField, 虚拟滚动不生效

What is the new behavior?

修复以上问题

去掉未使用的 overlayItemWidth 配置(下个feature版本用overlayClassName统一解决)

Other information

fix(pro:search): remove unused select field option
@idux-bot
Copy link

idux-bot bot commented Mar 13, 2023

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` 在多选下切换面板中选项选中状态
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code review

  1. The separator and showSelectAll properties of the SelectSearchFieldConfig are not necessary to be passed as parameters, as they have default values already.

  2. The overlayItemWidth property is not required as it is optional.

  3. The onSearch property should have a more descriptive name, such as onSearchValueChange, as it is used to indicate when the search value has changed.

  4. 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,
}
Copy link

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
}
}

Copy link

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
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Merging #1501 (ab909dc) into main (c217da6) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head ab909dc differs from pull request most recent head 53ac246. Consider uploading reports for the commit 53ac246 to get more accurate results

@@            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              
Impacted Files Coverage Δ
packages/components/cascader/src/types.ts 100.00% <100.00%> (ø)
packages/components/checkbox/src/types.ts 100.00% <100.00%> (ø)
packages/components/date-picker/src/types.ts 100.00% <100.00%> (ø)
packages/components/form/src/types.ts 100.00% <100.00%> (ø)
packages/components/input-number/src/types.ts 100.00% <100.00%> (ø)
packages/components/input/src/types.ts 100.00% <100.00%> (ø)
packages/components/radio/src/types.ts 100.00% <100.00%> (ø)
packages/components/rate/src/types.ts 100.00% <100.00%> (ø)
packages/components/select/src/types.ts 100.00% <100.00%> (ø)
packages/components/slider/src/types.ts 100.00% <100.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@danranVm danranVm merged commit 5def0ab into IDuxFE:main Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants