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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove ts-nocheck comments in select-v2 #16746
base: dev
Are you sure you want to change the base?
chore: remove ts-nocheck comments in select-v2 #16746
Conversation
馃憢 @makedopamine, thank you for contributing element-plus. |
Hello @makedopamine, thank you for contributing to element-plus, please see our guideline to see how to make contribution |
馃И Playground Preview: https://element-plus.run/?pr=16746 |
Found hundreds of |
I actually notice the problem what you say, however, its workload is somewhat heavy to address it completely in a single PR. And I think a large PR is hard for reviewers to review, so I prefer to split the task into separate PRs. |
|
||
export const SelectProps = buildProps({ | ||
export const selectProps = buildProps({ |
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.
It may be better to keep the first letter capitalized here, otherwise it will be a breaking change for users who use related values.
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.
You are right.
@@ -248,7 +255,7 @@ export const SelectProps = buildProps({ | |||
...useAriaProps(['ariaLabel']), | |||
} as const) | |||
|
|||
export const OptionProps = buildProps({ | |||
export const optionProps = buildProps({ |
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.
Same here.
@@ -190,7 +220,7 @@ export default defineComponent({ | |||
} | |||
|
|||
const onEscOrTab = () => { | |||
select.expanded = false | |||
select.expanded.value = false |
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.
Is there a bug here?
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.
Yep, it should indeed not be modified in this PR, causing confusion. I will revert it.
@@ -1,3 +1,5 @@ | |||
import type { Nullable } from '@element-plus/utils' |
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.
Maybe Nullable
should no longer be used here, as it will be deprecated later.
expanded: boolean | ||
tooltipRef: Ref<TooltipInstance> | ||
props: ExtractPropTypes<typeof selectProps> | ||
expanded: Ref<boolean> |
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.
Why has the type changed here?
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.
For select.expanded.value = false
@@ -18,7 +18,7 @@ export const defaultProps: Required<Props> = { | |||
options: 'options', | |||
} | |||
|
|||
export function useProps(props: Pick<ISelectV2Props, 'props'>) { | |||
export function useProps(props: ISelectV2Props) { |
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.
It seems that there is no need to change here. Only props.props
is used below, and only the corresponding types are extracted.
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.
I think the type should match the runtime value. Anyway, it doesn't matter. I'm fine with both.
import type { ISelectV2Props } from './token' | ||
import type { SelectEmitFn } from './defaults' | ||
import type { TooltipInstance } from '@element-plus/components/tooltip' | ||
import type { Nullable } from '@element-plus/utils/typescript' |
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.
Nullable
should no longer be used.
Thanks for your review. There's been a modification, please take a look. |
I pushed a new commit, kindly take note. |
b10e785
to
31abd48
Compare
76950f3
to
595ea25
Compare
No description provided.