Closed mhevery closed 2 years ago
[ Repro ]
When both the parent and child bind to host element the chlid wins. This is not correct as parent should have higher prioriy.
import { component$, Host, QRL, Slot, useStore } from '@builder.io/qwik'; export const App = component$(() => { const store = useStore({ count: 0 }); return ( <MyButton onClick$={() => store.count++} host:style={{ backgroundColor: 'red' }}> {store.count} </MyButton> ); }); interface MyButtonProps { onClickQrl?: QRL<(event: Event) => void>; } export const MyButton = component$( (props: MyButtonProps) => { return ( <Host onClickQrl={props.onClickQrl} style={{ backgroundColor: 'lightpink', padding: '1em' }}> <Slot /> </Host> ); }, { tagName: 'button' } );
In the above example, the final background-color should be red and it should have padding of 1em
background-color
red
padding
1em
Duplicated of https://github.com/BuilderIO/qwik/issues/263
[ Repro ]
When both the parent and child bind to host element the chlid wins. This is not correct as parent should have higher prioriy.
In the above example, the final
background-color
should bered
and it should havepadding
of1em