-
Notifications
You must be signed in to change notification settings - Fork 4k
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
breaking(popup): verticalOffset #2450
breaking(popup): verticalOffset #2450
Conversation
Add a verticalOffset prop to the popup.
Codecov Report
@@ Coverage Diff @@
## master #2450 +/- ##
==========================================
+ Coverage 99.73% 99.74% +<.01%
==========================================
Files 154 154
Lines 2692 2696 +4
==========================================
+ Hits 2685 2689 +4
Misses 7 7
Continue to review full report at Codecov.
|
Great, thanks for this! We had this same PR submitted some time ago and never finished. In an effort to keep the API consistent, let's consider a prop rename/restructure here. Currently, we have Option 1Rename <Popup horizontalOffset={} verticalOffset={} /> Option 2Allow <Popup offset={10} /> // horizontal
<Popup offset={{ x: 10, y: 20 }} /> // horizontal, vertical Thoughts? |
Heads up, this is actually a duplicate of #2444. I'll let the PR authors decide on which PR to focus efforts. |
@levithomason, I think option 1 fits best with SUI. Why not just add ‘horizontalOffset’ as an alias to offset? This way, it’s not a breaking change. You could add a warning about using ‘offset’ and deprecate it in a future version? |
Option 1 it is 👍. We don't support backward compatibility while in development ( |
Our changelog is auto-linked to PRs. So that users can easily identify breaking changes and upgrade accordingly, we include a very brief description of why we are breaking the API and a before/after snippet. Example PR here #1791. Let's update the description is this PR as well. |
Rename `offset` to `horizontalOffset` for consistency.
@levithomason please review changes, and that the PR description is correctly formatted for the change log. This also resolves #2444. |
Update docs for `horizontalOffset` and the new `verticalOffset` property.
The fourth offset example, vertical 50 from bottom center, seems to misbehave. The Popup appears then disappears immediately afterward. This is the snippet: <Popup
trigger={<Icon size='large' name='heart' circular />}
content='As expected this popup is way off to the bottom'
verticalOffset={50}
position='bottom center'
/> However, when changed to -50, it behaves correctly and is positioned far below as it should be. Seems there is a bug there. |
Stop popup disappearing when vertical offset applied.
@levithomason bug is now fixed and tested. Please review again. |
Awesome, this looks great. Thanks much! |
* feat(popup): verticalOffset Add a verticalOffset prop to the popup. * feat(popup): Rename offset prop Rename `offset` to `horizontalOffset` for consistency. * docs(popup): Update for offset Update docs for `horizontalOffset` and the new `verticalOffset` property. * fix(popup): vertical offset bug Stop popup disappearing when vertical offset applied.
Released in |
* feat(popup): verticalOffset Add a verticalOffset prop to the popup. * feat(popup): Rename offset prop Rename `offset` to `horizontalOffset` for consistency. * docs(popup): Update for offset Update docs for `horizontalOffset` and the new `verticalOffset` property. * fix(popup): vertical offset bug Stop popup disappearing when vertical offset applied.
Breaking Change
Popup must rename the
offset
property tohorizontalOffset
Before
After
Add a
verticalOffset
prop to the popup component.Fixes #2449.