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

Autocomplete: Passthrough to input not working #6922

Closed
Nandovga opened this issue Jul 24, 2024 · 4 comments · Fixed by #6926, #6938, leoo1992/GeradorQRCode#80 or leoo1992/GeradorQRCode#85 · May be fixed by mtech-31-quemistry/quemistry_client_web#20
Assignees
Labels
Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@Nandovga
Copy link

Describe the bug

When passing the property to PrimeReactProvider, the autocomplete component is not receiving the className parameterized in the object

import { AutoCompletePassThroughOptions } from "primereact/autocomplete";

export const autocomplete: AutoCompletePassThroughOptions = {
    root: {
        className: "w-100 fs-7 p-0 d-flex"
    },
    input: {
        className: "autocomplete-custom"
    }
};
import { PrimeReactProvider } from "primereact/api";
import { configPrimeReact } from "../primereact";

<PrimeReactProvider value={{ pt: configPrimeReact }}>
    <App {...props}/>
</PrimeReactProvider>

Reproducer

No response

PrimeReact version

10.7.0

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Chrome 127, Edge

Steps to reproduce the behavior

No response

Expected behavior

No response

@Nandovga Nandovga added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jul 24, 2024
@melloware
Copy link
Member

your syntax is wrong see: https://stackblitz.com/edit/efgeef?file=src/App.jsx

<AutoComplete
        value={value}
        suggestions={items}
        completeMethod={search}
        onChange={(e) => setValue(e.value)}
        pt={{
          root: {
            className: 'w-100 fs-7 p-0 d-flex',
          },
          input: {
            root: {
              className: 'autocomplete-custom',
            },
          },
        }}
      />

@melloware melloware added Resolution: Cannot Replicate Issue could not be replicated by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jul 24, 2024
Copy link

We're unable to replicate your issue, if you are able to create a reproducer or add details please edit this issue. This issue will be closed if no activities in 20 days.

@melloware melloware changed the title Autocomplete - PrimeReactProvider Autocomplete: Passthrough to input not working Jul 25, 2024
@Nandovga
Copy link
Author

That way it worked. But checking the AutoCompletePassThroughOptions typing, I think it's not correct because it doesn't recommend using root within the input.

@melloware melloware added Typescript Issue or pull request is *only* related to TypeScript definition and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Jul 25, 2024
@melloware
Copy link
Member

let me fix the Typescript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment