Im trying to use object-fit for an element in my app. My IDE doesnt recognize this:
child.style.objectFit = 'cover';
For some reason. It has squigly lines under objectFit. And when i do this:
child.style.setProperty( 'object-fit', 'cover', '!important' );
It wont show up in the Inspector of my browser. So it doesnt apply the code.
Why does it behaves so strangely?
Apparently your IDE (and environment) can't recognize the typings properly. To overcome that you can try casting it before using:
(child.style as any).objectFit = 'cover';