Proposal: Reconsider the interface of dropdown menus #634
Labels
Component: KDropdownMenu
P3 - low
Priority: Stretch goal
TAG: dev experience
TODO: needs decisions
Further discussion and planning necessary
TODO: Needs investigation
type: proposal
New feature or request
Product
Kolibri, Studio.
Description
In #583 we discussed how KDS should expose dropdown menus and context menus. We currently have a KDropdownMenu component that can behave like a contextMenu if we pass it an
isContextMenu
prop (see the description of #583). However, this can be very tightly coupled if we want to extend dropdown functionality later to render more than just menus.There are proposals to improve this, such as using composables
const { isOpen, open, close, positionX, positionY } = useKDropdown();
to decouple the functionality, this could bring several benefits (see this comment), but research is needed to determine if it is technically feasible.Another proposal suggests maintaining the Components interface and creating separate components:
KDropdown
,KMenu
,KContextClick
, while keepingKDropdownMenu
as a reusable component for the most common use case. This approach would provide us with a more flexible interface while maintaining its simplicity, allowing us to use the base components in other contexts if needed.We still need to investigate further into the possibilities of improving the dropdown menu implementation and determine what steps we can take in KDS.
The text was updated successfully, but these errors were encountered: