-
Notifications
You must be signed in to change notification settings - Fork 170
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
different attribute handling in div/span etc. and svg #240
Comments
Strange... the behaviour described above seems to depend on the kind of attribute: code like
produces Right now, it seems that the As a consequence, I'll use the following code as a workaround from now on:
|
This is how Preact works - it is setting the This is why youre seeing different behavior for |
Oh, good to know... Thank you very much for this explanation! |
I'm not sure I understand this. But I think it may be related an issue I'm having... If I want to dynamically set an What's going on here? likewise,
produces but if I use static style props (e.g. edit: Ok, this seems to work: let baseLayerThumb = generateStageThumbnail(konvaStage);
// console.log('baselayer', baseLayerThumb);
let attr = {style:`background-image: url(${baseLayerThumb});`};
return html`
<div class="miniboard">
<div class="miniboard-thumb" ...${attr}> this seems like a pretty basic, critical use case, and it's weird that it doesn't 'just work'. Is this really the way to do it, it can't be inline? |
Looks like you forgot to wrap the output in a backtick, so GitHub tried to render it directly.
This works just fine, albeit once you add content to the div (else there would be nothing to apply that
Can you provide a more full example? Do you have some build tooling stepping in here and causing issues? This does "just work". |
It shouldn't matter whether you extract an object -style="background-image: ${baseLayerThumb};
+style="background-image: url(${baseLayerThumb}); |
I am using "htm" with "preact" binding
When I'm using code like the following
"htm" handles the ids differently:
<div/>
and<span/>
get anid
with the value"false"
while<svg/>
elements behave as expected (the first one gets noid
, the second one an id with the valueid-4
)Is that the expected behaviour? I've also tested other attributes, always with the same result...
The text was updated successfully, but these errors were encountered: