-
Notifications
You must be signed in to change notification settings - Fork 63
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
LG-4447: refactor Popover positioning logic and remove unused contentClassName prop #2457
Conversation
🦋 Changeset detectedLatest commit: f7f3e31 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +620 B (+0.05%) Total Size: 1.36 MB
ℹ️ View Unchanged
|
/** | ||
* Class name applied to the popover content container | ||
*/ | ||
contentClassName?: string; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks to have been inadvertently added here:
ffd11f2#diff-e9e2c24eb911dfb2ed3f9642d8bde92ee7b23486fec85a6a9729c2b6eca437dbR141-R144
date-picker
package actually consumes a generated contentClassName
that is exported from popover
package: ffd11f2#diff-57feaaf19fc44238c8170c0d4db8c0ba8418abd374058c90d5424f51d426dbbaR2-R10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shaneeza the contentClassName
prop that gets passed in that spread ...rest
doesn't do anything in the div
. I think it was mistakenly added to the types file
It doesn't have any prod usage: https://github.com/search?q=(org:10gen+OR+org:evergreen-ci+OR+org:mongodb+OR+org:mongodb-js+OR+org:mongodb-labs+OR+org:wiredtiger)+AND++%3CPopover+AND+contentClassName%3D&type=code
The generated contentClassName
is exported, so consumers can rely on that instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Even if it was a mistake, removing it should probably be a major change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. This is getting merged into an integration branch, and I'm planning to consolidate all the changelogs before merging to main. The final version will be a major bump for all changes
e3e0ab4
to
228a36a
Compare
}; | ||
} | ||
|
||
const ContentWrapper = forwardRef<HTMLDivElement, { children: ReactNode }>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you add back the comment about infinite looping here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't remove the comment. I moved the comment to the tsdocs for UseContentNodeReturnObj
because I figured that was easier to identify/read for future devs reading this code. Open to feedback if you have a better idea on how to document it
3c16270
to
4fde308
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this before, but we usually don't create a single file for hooks and components. We make an individual file for each component, and we add hooks to the utils folder. To be consistent with the other components, I think it makes sense to use the same pattern. Check out Toast
as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see polymorphic does a *.hooks.ts
file too. I think explicitly separating hooks from utils is more conventional and similarly supported with how we have a hooks package. I will leave this as-is for now but removed the components and reverted to the previous JSX. Also will add this as a discussion topic for the next dev sync
…ClassName prop (#2457) * Refactor popover styles * Remove redundant contentClassName prop * Clean up Popover positioning logic * Changesets * Reorg code * useIsomorphicLayoutEffect instead of useMemo * Update changesets * Revert changes
…ClassName prop (#2457) * Refactor popover styles * Remove redundant contentClassName prop * Clean up Popover positioning logic * Changesets * Reorg code * useIsomorphicLayoutEffect instead of useMemo * Update changesets * Revert changes
…ClassName prop (#2457) * Refactor popover styles * Remove redundant contentClassName prop * Clean up Popover positioning logic * Changesets * Reorg code * useIsomorphicLayoutEffect instead of useMemo * Update changesets * Revert changes
…ClassName prop (#2457) * Refactor popover styles * Remove redundant contentClassName prop * Clean up Popover positioning logic * Changesets * Reorg code * useIsomorphicLayoutEffect instead of useMemo * Update changesets * Revert changes
✍️ Proposed changes
contentClassName
propuseReferenceElement
,useContentNode
, andusePopoverPositioning
hooks🎟 Jira ticket: LG-4447
✅ Checklist
For bug fixes, new features & breaking changes
yarn changeset
and documented my changes🧪 How to test changes