TIL: Putting a classes on a polyline (or similar) element inside a group causes something annoying to happen with the classes placed on the use tags using the groups containing previously mentioned polyline (or similar) tag; namely, only the classes placed on the last use tag take effect for all other use tags.
<defs>
<g id="foo">
<polyline points="0 0 10 10" class="fizz"/>
</g>
</defs>
<use xlink:href="#foo" class="bar" x="0" y="0"/>
<use xlink:href="#foo" class="buzz" x="0" y="10"/>
The buzz class will be retro-actively applied to the use tag above it in this instance, but if you had:
<defs>
<g id="foo">
<polyline points="0 0 10 10"/>
</g>
</defs>
<use xlink:href="#foo" class="bar" x="0" y="0"/>
<use xlink:href="#foo" class="buzz" x="0" y="10"/>
Then the classes would be applied appropriately. This seems to only be the case when the fizz class uses an animation property:
What are some similarly perplexing / annoying situations you've come across?
(P.S. And if you have any insight into why the above situation happens [only tested on chrome], that would be cool too, but more interested in hearing stories about your situations.)
Few interesting "gotcha"s that often trip Ruby beginners ...
In Python: the fact that default arguments are calculated at definition time. Completely obvious in retrospect, but well, I was young.
While learning any new language, I usually try to look to best practice and real production Apps, but in most of the beginners tutorials, it is usually very dummy and basic, though it is good to start but what's after that?
when you already know about one platform and tries to learn another one, you want to speed up yourself, you'll soon realize this is not good, and production level goal, how should I best practice. their is always several ways to do it.
now I realize, do the simple one first, look at the complex and harder ways(but stick to your self once you understand that properly only then tries to jump slowly), and try to make it better as an ongoing process. take your initial project while learning just improving.
Siddarthan Sarumathi Pandian
Full Stack Dev at Agentdesks | Ex Hashnode | Ex Shippable | Ex Altair Engineering
As a React noob, I think I can share this: When you are attaching an onClick handler and have to pass parameters to the handler, you need to use arrow functions. Doing something like
onClick={this.submit(data)}will not work.You should do something like
onClick={() => this.submit(data)}.