Skip to content

Button autoResize by button container #2404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 10, 2024
Merged

Conversation

imbrian
Copy link
Contributor

@imbrian imbrian commented Jun 5, 2024

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 the body 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-side disableMaxHeight changes can then be released, following by #2361

Groups who should review (if applicable)

❤️ Thank you!

@imbrian imbrian marked this pull request as ready for review June 6, 2024 16:08
@imbrian imbrian requested a review from a team as a code owner June 6, 2024 16:08
Copy link
Contributor

@nikrom17 nikrom17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@ravishekhar ravishekhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@imbrian imbrian merged commit 80f48b0 into main Jun 10, 2024
4 checks passed
@imbrian imbrian deleted the feature/buttonAutoResizeElement branch June 10, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants