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

Tree: Invalid typing of the default slot #4608

Closed
Magiczne opened this issue Oct 13, 2023 · 0 comments
Closed

Tree: Invalid typing of the default slot #4608

Magiczne opened this issue Oct 13, 2023 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Magiczne
Copy link
Contributor

Describe the bug

Version 3.26 introduced typing for default slot like so and broke typing for the default slot (which was any, but worked)

export interface TreeSlots {
    /**
     * Default content slot.
     */
    default(): VNode[];
 
    // ...
}

Which is not correct, as default slot is exposing node slot, which was previousle handled by this fragment of TreeSlots:

/**
 * Optional slots.
 * @todo
 */
[key: string]: (node: any) => VNode[];

The code should look like this:

export interface TreeSlots {
    /**
     * Default content slot.
     */
    default(scope: { node: TreeNode }): VNode[];
}

Reproducer

PrimeVue version

3.26.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@Magiczne Magiczne added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 13, 2023
@tugcekucukoglu tugcekucukoglu added this to the 3.37.0 milestone Oct 13, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 13, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants