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

Accordion: Documentation and Typescript definition do not match #6389

Closed
nrueckmann opened this issue Apr 12, 2024 · 9 comments · Fixed by #6390 or leoo1992/GeradorQRCode#23
Closed
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component. Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@nrueckmann
Copy link

nrueckmann commented Apr 12, 2024

PrimeReactPTOptions defines a field accordiontab to set the passthrough oppions for the AccordionTab component (see

accordiontab?: AccordionTabPassThroughOptions;
)

export interface PrimeReactPTOptions {
    /**
     * Custom passthrough(pt) options for Accordion.
     */
    accordion?: AccordionPassThroughOptions;
    /**
     * Custom passthrough(pt) options for AccordionTab.
     */
    accordiontab?: AccordionTabPassThroughOptions;

But documentation (https://primereact.org/accordion/#tailwind) is using a field tab inside of AccordionPassThroughOptions.

It seems like the documentation is right, because PrimeReact does not catch up the accordiontab field if defined.

@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 12, 2024
@melloware melloware added Typescript Issue or pull request is *only* related to TypeScript definition and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 12, 2024
@melloware
Copy link
Member

Actually accordiontab is right and tab is wrong. Let me fix.

@melloware melloware self-assigned this Apr 12, 2024
@melloware melloware added this to the 10.6.4 milestone Apr 12, 2024
melloware added a commit to melloware/primereact that referenced this issue Apr 12, 2024
@melloware melloware changed the title Accordion: Documenttaion and Typescript definition do not match Accordion: Documentation and Typescript definition do not match Apr 12, 2024
@melloware
Copy link
Member

PR submitted

@nrueckmann
Copy link
Author

Thx, but it looks like your PR does not touch the type definitions which should be adjusted as well.

@melloware
Copy link
Member

Which type defs do you refer?

@nrueckmann
Copy link
Author

If i understand your PR right, you just changed the name of the field from tab to accordiontab. My initial issue was a different story:

PrimeReactPTOptions says it has a accordiontab field, but using it does not work.
AccordionPassThroughOptions says it does not have a tab or accordiontab field, but using it does work.

So the following documentation does not match the types:

const Tailwind = {  
    accordion: {
        root: 'mb-1',
        tab: {} // this field is not valid as AccordionPassThroughOptions does not have a field `tab` or `accordiontab`
    }
}

@melloware
Copy link
Member

Yep it looks like tab/accordiontab has always been missing. Let me update.

melloware added a commit to melloware/primereact that referenced this issue Apr 12, 2024
@melloware
Copy link
Member

OK updated my PR.

melloware added a commit to melloware/primereact that referenced this issue Apr 12, 2024
melloware added a commit to melloware/primereact that referenced this issue Apr 13, 2024
nitrogenous added a commit that referenced this issue Apr 25, 2024
Fix #6389: Passthrough accordiontab not tab
@nitrogenous nitrogenous added the Type: Bug Issue contains a defect related to a specific component. label Apr 30, 2024
@melloware
Copy link
Member

@nrueckmann it looks like this fix broken users again...

@melloware
Copy link
Member

I see the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component. Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
3 participants