fabiospampinato / cash

An absurdly small jQuery alternative for modern browsers.
MIT License
6.96k stars 271 forks source link

Support undoing CSS transforms when measuring dimensions #396

Open vovayatsyuk opened 2 years ago

vovayatsyuk commented 2 years ago

Current behavior

The following code decreases actual dimensions of the element if the parent element uses transform property:

$('.el').height($('.el').height() + 5);

Expected behavior

The element should increase its height.

Codepen

https://codepen.io/vovayatsyuk/pen/qBVYQJJ

Proposed solution

Add a notice to the migration guide to use .css('height') instead?

fabiospampinato commented 2 years ago

When reading the height the eventual transform property is not kind of undone, this is mentioned in the migration guide.

So in some sense it is working as expected.

If this is implementable with little code though it might be a nice to have feature 🤔

Add a notice to the migration guide to use .css('height') instead?

Done, thanks 👍