Button autoResize by button container #2404
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.
Description
This change sets
autoResize.element
on the Button component to the button container. I'm introducing a new class to prevent reliance on an existing class with other uses.Why are we making these changes? Include references to any related Jira tasks or GitHub Issues
Unblocks DTPPCPSDK-1915 #2361
Does not implement
disableMaxHeight
Resolves autoResize issue introduced when adding the
disableMaxHeight
prop, which sets container heights within the iframe to 100%. This height prevented resize events, because zoid observes thebody
by default. A height of 100% prevented this resize from occurring, because it would always match the initial container height.Reproduction steps
The issue occurred when the window was resized after the second render.
Screenshots (if applicable)
Test environment with this PR + current mainline first/second render:
te-button-autoresize
Storybook TE with this change and disable max height changes in SCNW (does not include the changes from #2361 to fully support
disableMaxHeight
, but this change has been tested with #2361 locally)Dependent Changes (if applicable)
This adds a new class and sets button resize behavior based on this new class. Both first and second render need this version to resize properly.
This change has been tested against the current mainline branch for first/second render. It should be released ahead of the
disableMaxHeight
changes. The server-sidedisableMaxHeight
changes can then be released, following by #2361Groups who should review (if applicable)
❤️ Thank you!