primevue-tailwind icon indicating copy to clipboard operation
primevue-tailwind copied to clipboard

ptOptions overrides the defaults of its children

Open sergeydus opened this issue 5 months ago • 0 comments

ptOptions of parent components seem to override the default options of it's child component

expected: the ptOptions of a parent shouldn't affect the styling of the children

Primevue Version: 4.0.5

Firstly, i've overwritten the default ptOptions to be: app.use(PrimeVue, { unstyled: true, pt: Aura, ptOptions:{ mergeProps: false, } });

this is how the following code looks like without ptOptions, the Button behaves as expected: <Panel> <Button icon="pi pi-arrow-right" pt:root="bg-green-500" @click="visible = true" /> </Panel> image

now, if I override the ptOptions in panel, the Buttons style changes, despite the ptOptions being for the Panel component, rather than the Button Component:

<Panel :ptOptions="{ mergeProps: true, mergeSections: true, }" > <Button icon="pi pi-arrow-right" pt:root="bg-green-500" @click="visible = true" /> </Panel>

which results in:
image

reproduction: https://stackblitz.com/edit/wf943d?file=src%2FApp.vue in the reproduction, simply remove/add the ptOptions in panel, and see how it affects the Button's styling

sergeydus avatar Sep 16 '24 20:09 sergeydus