Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sfc-gh-lwilby
Copy link
Collaborator

@sfc-gh-lwilby sfc-gh-lwilby commented Mar 10, 2025

Describe your changes

This fixes an issue where use_container_width is ignored if the help parameter is passed to st.popover by ensuring element.useContainerWidth is provided to BaseButtonTooltip as well as BaseButton.

GitHub Issue Link (if applicable)

Closes #10693

Testing Plan

Adds some playwright tests similar to the existing use_container_width tests but including the help option.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@sfc-gh-lwilby sfc-gh-lwilby added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Mar 10, 2025
@sfc-gh-lwilby sfc-gh-lwilby marked this pull request as ready for review March 10, 2025 17:42
@sfc-gh-lwilby sfc-gh-lwilby changed the title [WIP] drill down useContainerWidth to BaseButtonTooltip and add e3e tests [WIP] Popover with help and use_container_width is rendered correctly Mar 10, 2025
@sfc-gh-lwilby sfc-gh-lwilby changed the title [WIP] Popover with help and use_container_width is rendered correctly Popover with help and use_container_width is rendered correctly Mar 10, 2025
<BaseButtonTooltip help={element.help}>
<BaseButtonTooltip
help={element.help}
containerWidth={element.useContainerWidth}
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion (non-blocking): I think it could be a good idea to mark containerWidth as a required prop in BaseButtonTooltip. The benefit is that we would get compiler-time checking for all locations in which BaseButtonTooltip is used.

Copy link
Collaborator

@mayagbarnes mayagbarnes Mar 10, 2025

Choose a reason for hiding this comment

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

Added in st.page_link PR 👍🏼 - just need this PR merged before I can merge

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great, thank you Maya for adding this.

@sfc-gh-lwilby sfc-gh-lwilby merged commit c558d4f into develop Mar 11, 2025
33 checks passed
@sfc-gh-lwilby sfc-gh-lwilby deleted the fix/popover-help-use-container-width branch March 11, 2025 09:46
kajarenc pushed a commit that referenced this pull request Mar 11, 2025
## Describe your changes

This fixes an issue where `use_container_width` is ignored if the `help`
parameter is passed to `st.popover` by ensuring
`element.useContainerWidth` is provided to `BaseButtonTooltip` as well
as `BaseButton`.

## GitHub Issue Link (if applicable)

Closes #10693

## Testing Plan

Adds some playwright tests similar to the existing `use_container_width`
tests but including the help option.

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st.popover won't use container width if help arg is passed

4 participants