Skip to content
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

feat(widget): add maxHeight parameter for the widget #5127

Merged
merged 5 commits into from
Nov 26, 2024

Conversation

shoom3301
Copy link
Collaborator

@shoom3301 shoom3301 commented Nov 25, 2024

Summary

https://www.titanxhub.com/swap - if you click "connect wallet" in the widget here, you will see that the modal is displayed not correctly.
It happens because we always take document.body.offsetHeight as a max height for the widget.
In order to handle that, I've added a new parameter - maxHeight.

To Test

  1. Scroll widget configurator settings to the bottom (see the pic bellow)
  2. Input {"maxHeight": 200} in "Raw JSON params" field
  3. Click "Update widget"
  • Widget height should be limited up to 200px
image

@shoom3301 shoom3301 requested review from a team November 25, 2024 11:59
@shoom3301 shoom3301 self-assigned this Nov 25, 2024
Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cosmos 🔄 Building (Inspect) Visit Preview Nov 26, 2024 7:06am
cowfi 🔄 Building (Inspect) Visit Preview Nov 26, 2024 7:06am
explorer-dev 🔄 Building (Inspect) Visit Preview Nov 26, 2024 7:06am
swap-dev 🔄 Building (Inspect) Visit Preview Nov 26, 2024 7:06am
widget-configurator 🔄 Building (Inspect) Visit Preview Nov 26, 2024 7:06am

@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/widget-lib",
"version": "0.17.0",
"version": "0.18.0",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would like to release a new version just after merging the PR

Copy link

Report too large to display inline

View full report↗︎

Copy link
Contributor

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

Hey @shoom3301 , great, thank you!
Please, don't forget to update dev docs with this change :)

And I hope that users will figure out their the best widget height to specify
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants