Add bubbleImageMaxHeight
and bubbleImageMinHeight
#5236
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Breaking changes
styleOptions.bubbleImageHeight
is being deprecated in favor ofstyleOptions.bubbleImageMaxHeight
andstyleOptions.bubbleImageMinHeight
. The option will be removed on or after 2026-07-05180
and maximum height of240
, instead of fixed height of240
240
Added
styleOptions.bubbleImageMaxHeight
andstyleOptions.bubbleImageMinHeight
for variable image height, in PR #5236, by @compulimDescription
Previously, to support IE11, we could not use
object-fit
. For simplicity, we make images with fixed height.As we discontinued support of IE11, we can now making image height variable (min/max) and relies
object-fit
to honor the aspect ratio.Design
The image resize logic is "enlarge image to meet fixed width, then crop/pad top/bottom to meet height."
Current design is "fixed height", it will crop the image if it is too tall, or pad the image if it is too short.
This PR will enable variable height by min/max. When min is set to
0
and max is set toInfinity
, it means "fixed width and make the image as short/tall as it fit."When the image is taller than max, it will be cropped. When the image is shorter than min, it will be padded.
When min/max are set to the same number, say,
240
, it will always crop/pad the image at height of 240px and this is same as today's behavior and enable backward compatibility.If the deprecating
styleOptions.bubbleImageHeight
is set, it will propagate tomin
/max
value and is backward compatible.Specific Changes
styleOptions.bubbleImageMaxHeight
andstyleOptions.bubbleImageMinHeight
, both defaults to240
styleOptions.bubbleImageHeight
and changed default toundefined
, which will honormin
/max
CHANGELOG.md
Review Checklist
Browser and platform compatibilities reviewedz-index
)Documents reviewed (docs, samples, live demo)Internationalization reviewed (strings, unit formatting)package.json
andpackage-lock.json
reviewedSecurity reviewed (no data URIs, check for nonce leak)