solid-docs icon indicating copy to clipboard operation
solid-docs copied to clipboard

classList not working when specified before class

Open ku1ik opened this issue 4 years ago • 3 comments

Describe the bug

The order of class and classList props matters.

To Reproduce

Create a component with both class and classList, with classList specified first:

<div classList={...} class="...">...</div>

Observe that classes from classList are ignored (or probably overwritten by class).

Expected behavior

The order of class and classList shouldn't matter, or it should be noted in the docs (e.g. here https://www.solidjs.com/docs/latest/api#classlist) that classList must go after class.

When it's reversed all works fine, both classes from "static" class and "dynamic" classList are used.

Additional context

solid-js 1.1.2

ku1ik avatar Sep 08 '21 08:09 ku1ik

Yeah that's true. I wonder if it is really best to automatically change the order. These do need to run in sequence though. It's much simpler for me to document this for now and consider the implications of re-ordering things later.

ryansolid avatar Sep 08 '21 16:09 ryansolid

Sure, sounds good. It's not a big deal, just a small gotcha, and mentioning this in the docs should be good enough.

ku1ik avatar Sep 08 '21 18:09 ku1ik

Oops closed the wrong issue. In any case, I'm going to send this over to docs.

ryansolid avatar Sep 09 '21 05:09 ryansolid

I am looking into writing an article on how I built my first solid-start app? Maybe instead of writing it as an article I can contribute to docs? Would that be possible?

vanillacode314 avatar Oct 19 '22 08:10 vanillacode314

I am looking into writing an article on how I built my first solid-start app? Maybe instead of writing it as an article I can contribute to docs? Would that be possible?

At the moment we have completely different docs for Solid-Start. But you can contribute to these docs in other ways through sharing your experiences with Solid and sharing anything that you think anyone new to Solid should know

michaelessiet avatar Oct 22 '22 21:10 michaelessiet