You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The new strategy for createElementSize introduced in 2.0.22 (which to be fair, is more reasonable) is not backwards compatible. Instead, additional strategies for calculating element size should be added which respect semantic versioning.
In my case, I was using createElementSize for proportional scaling to change the transform: scale style of the observed element. Using bounding client rect breaks this behavior.
Suggest A Solution
I have two suggestions, both of which are minor revisions (2.1.0) that respect semantic versioning:
Deprecate createElementSize and create new primitives for each strategy:
createElementBorderBoxSize
createElementContentBoxSize
createElementContentRectSize
createElementBoundingClientRectSize
Like the suggestion in Use contentBoxSize and borderBoxSize instead of contentRect in createElementSize #469, add a strategy parameter to createElementSize for how to calculate the size; 'borderBoxSize' | 'contentBoxSize' | 'contentRect' | 'getBoundingClientRect'. The default value of this parameter is contentRect, which match the behavior prior to 2.0.22.
The text was updated successfully, but these errors were encountered:
vveisard
changed the title
@solid-primitives/resize-observer: Implement new strategies for determining element size
@solid-primitives/resize-observer: Implement new strategies for determining element size and revert changes in 2.0.22
Oct 8, 2023
Describe The Problem To Be Solved
The new strategy for
createElementSize
introduced in 2.0.22 (which to be fair, is more reasonable) is not backwards compatible. Instead, additional strategies for calculating element size should be added which respect semantic versioning.In my case, I was using
createElementSize
for proportional scaling to change thetransform: scale
style of the observed element. Using bounding client rect breaks this behavior.Suggest A Solution
I have two suggestions, both of which are minor revisions (2.1.0) that respect semantic versioning:
createElementSize
and create new primitives for each strategy:contentBoxSize
andborderBoxSize
instead ofcontentRect
increateElementSize
#469, add astrategy
parameter tocreateElementSize
for how to calculate the size;'borderBoxSize' | 'contentBoxSize' | 'contentRect' | 'getBoundingClientRect'
. The default value of this parameter iscontentRect
, which match the behavior prior to2.0.22
.The text was updated successfully, but these errors were encountered: