-
Notifications
You must be signed in to change notification settings - Fork 138
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
|
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'