Skip to content

Conversation

logonoff
Copy link
Member

What: Closes #11929 #11574

Additional issues:

@patternfly-build
Copy link
Contributor

patternfly-build commented Jul 23, 2025

@logonoff logonoff force-pushed the menucontainer branch 3 times, most recently from fb8e369 to cf608bc Compare July 23, 2025 20:17
@logonoff logonoff changed the title fix(MenuContainer): use PopperProps for MenuPopperProps feat: extend PopperProps in derivative component types Jul 23, 2025
@@ -4,7 +4,7 @@ section: components
subsection: menus
cssPrefix: pf-v6-c-select
propComponents:
['Select', 'SelectOption', 'SelectGroup', 'SelectList', 'MenuToggle', 'SelectToggleProps', 'SelectPopperProps']
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall, I think this isn't introducing a breaking change. but it's possible that these extra interfaces were pulled out the way they were so that they could be documented in our API docs on the website. People won't know without looking at the code how to manipulate these popper features like direction and width if we remove the interfaces all together.

It is possible we could include Popper props on the API docs instead. I'm interested what the team thinks

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we would want to include PopperProps since it includes some attributes that aren't in the extended types.

What's the motivation for pulling the extended types out?

Copy link
Member Author

@logonoff logonoff Jul 28, 2025

Choose a reason for hiding this comment

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

SelectPopperProps doesn't show any of the properties inherited from PopperProps, so there is no point in showing it in the documentation

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Now that you added PopperOptions I think you can add that since it won't include the popper attributes that aren't actually on popperProps. It will then list it as the type for popperProps in the component prop documentation with a link

image

and that link will point to the interface docs of PopperOptions on each derivative component page.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

sounds good. in this case, should we still keep SelectPopperProps, etc. exported as a type, to avoid breaking builds?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think we would need to still keep it around until our next breaking change

/** Flag to prevent the popper from overflowing its container and becoming partially obscured. */
preventOverflow?: boolean;
}
export type DropdownPopperProps = Omit<PopperProps, 'trigger' | 'triggerRef' | 'popper' | 'popperRef' | 'isVisible'>;
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing I'm thinking of when I look at these, rather than having Omit<PopperProps, 'trigger' | 'triggerRef' | 'popper' | 'popperRef' | 'isVisible'>; in every derivative component what if we moved that under Popper to DRY things up and then just reexport that in each derivative component under the appropriate name?

@logonoff logonoff force-pushed the menucontainer branch 2 times, most recently from 8f64e28 to 6ac728c Compare July 28, 2025 18:18
Copy link
Contributor

@wise-king-sullyman wise-king-sullyman left a comment

Choose a reason for hiding this comment

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

🥳

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.

Bug - MenuContainer - MenuPopperProps is not fully described
4 participants