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(Combobox): update AcceptableValue inside Combobox.vue #677

Merged
merged 1 commit into from
Feb 9, 2024

Conversation

romanhrynevych
Copy link
Contributor

Please first read this issue: radix-vue/shadcn-vue#327

So I delved deeper inside radix-vue codebase and searched that type AcceptableValue = string | number | boolean | object

But object type inside TS is more that just object we think about:

let obj: object;
obj = {}; // Allowed
obj = []; // Allowed
obj = () => {}; // Allowed
obj = 42; // Not allowed, because 42 is a primitive type

type Object don't feet too I think:

let obj: Object;
obj = {}; // Allowed
obj = []; // Allowed
obj = new Object(); // Allowed
obj = () => {}; // Not allowed, because () => {} is not an instance of Object

So I think that the best object for this values will be PlainObject:

type PlainObject = Record<string, any>;

So, this PR change object to Record<string, any>

If you think about other edge cases, I'm open to chat and discussion 🙂

Copy link
Member

@zernonia zernonia left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @romanhrynevych !

@zernonia zernonia merged commit 8296b78 into radix-vue:main Feb 9, 2024
2 checks passed
@romanhrynevych romanhrynevych deleted the fix/replace-object-type branch February 9, 2024 08:36
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