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: elm draft split button #470
Conversation
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.
we have a MenuList component in Elm right?
I was thinking the same thing.
I'm not sure I understand here. Is there a reason why this component can't also rely on Kaizen's MenuList? There is an Elm one as @lijuenc mentioned. It's at draft-packages/menu-list/KaizenDraft/MenuList/MenuList.elm. |
Aaaaand I just noticed there's no Storybook story for the Elm MenuList 🤦♂️ which could be misleading to someone building a component like this. I'll look into that. The Elm Select imports the Elm MenuList (via DropdownMenu) so it might be a place to look for an example of that. |
keyDecoder = | ||
Decode.map toMsg (Decode.field "key" Decode.string) | ||
|
||
toMsg : String -> Msg menuItemMsg |
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 is a key helper in Kaizen.Events that can do this
_ -> | ||
NoOp | ||
in | ||
Sub.batch |
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.
These subscriptions will be firing for every onClick and keydown on the page even if the split button is not being used. Shouldn't they only fire when a SplitButtonState is open
?
01dbf6e
to
3e250a4
Compare
We wanted to avoid depending on draft things (we wanted to depend only on stable components). If the menuList draft has a major change in the future our darft split button won't block its release. If we need to change the things for this particular menu, we don't need test backwards compatibility with the other areas using the menulist. |
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.
LGTM 👍
This is the elm implementation of the split button. It is very limited at the moment and does only the necessary for its first usage (survey plans app).
Functionalities and limitations: