DEV Community

Discussion on: How to make a rotational (knob) input with Web Components

Collapse
 
krhoyt profile image
Kevin Hoyt

SVG and trigonometry FTW! Really nice write-up.

It is fun to see how other web component nerds organize their code. There should be way more of us rather than "Framework all teh thingz!" [Don't get me wrong, frameworks have their place. Blah, blah, blah...]

Interesting note, that this.attachShadow() returns a ShadowRoot instance, but it also creates a "this.shadowRoot" property on the component. Assigning the ShadowRoot seems more readable, but it is strangely not necessary. Don't believe me? Try it. Don't assign it, and then reference "this.shadowRoot" in the subsequent code. Mind blown!

Collapse
 
ndesmic profile image
ndesmic

You're right, I can probably axe the extra property. Thanks for the tip!