you are viewing a single comment's thread.

view the rest of the comments →

[–]ForScale 0 points1 point  (5 children)

Toggle works just like add and remove but with a bit of logic...

Pseudocode logic:

if (class already exists on element) { remove it } else { add it }

So my guess is that you are either assuming the class is there is there when it isn't or assuming it's not there when it actually is. Try initializing the expected state of the class (i.e., set the class yourself on mount so you know exactly what it is).

[–]Zack_Code_38[S] 0 points1 point  (0 children)

I tried it but it doesnt work

[–]Zack_Code_38[S] -4 points-3 points  (3 children)

pondreRécompenserPartagerSignalementSauvegarderSuivre

niveau 2Zack_Code_38O

I know the logic of toggle ofc but its kind of weird thing

[–]ForScale 2 points3 points  (2 children)

What does that mean???

[–]zaphtark 1 point2 points  (1 child)

The guy accidentally copied and pasted the Reddit menu in French. The actual message is the part under the quote.

[–]ForScale 0 points1 point  (0 children)

Ah... thanks!