-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement Menu #286
Implement Menu #286
Conversation
yes! this is looking fantastic!
I can't think of a use case where we want to force a menu open 🤔
n/a
what would these modifiers do?
I'm not sure -- if it ends up not working, we can just say "see Popover args" for now with a link -- the way I'm doing typedoc introspection is super weird, and I have an issue open with the maintainer to maybe one day have some help figuring stuff out 😅 github.com/TypeStrong/typedoc/issues/2528
I do, yes |
They would be used to "register" items and separators. Example: <Menu as |m|>
<button type="button" {{m.trigger}}>Menu</button>
<m.Content as |c|>
<div {{c.item}}>Item 1</div
<div {{c.item}}>Item 2</div
<div {{c.separator}}></c.Item>
<div {{c.item}}>Item 3</div
</m.Content>
</Menu>
Now that I think about it, the trigger should also have |
Ah yeah, more reason for components for the items and separators. For the trigger modifier, it can still manage that aria attribute, 'cause i don't think we ever omit it? |
For the trigger, there's also |
Another argument in favor is:
So, I think we shouldn't encourage the user to use any element at all, since it requires interactivity. |
@NullVoxPopuli this PR is ready for review. 🙏 |
@NullVoxPopuli feedback was applied |
Dependent on CrowdStrike/ember-velcro#190 |
Opening the PR to gather initial feedback on the approach.
Currently opens/closes the popover with internal state.
@NullVoxPopuli is this initial approach what you expected?
Next step is yielding the Item and Separator components from Content.
I think a good first goal for the Menu would be an API like:
Some questions I have:
@isOpen
arg, to control the open state of the Menu from the outside?@onToggle
action?<ComponentSignature @module="components/menu" @name="Signature" />
probably won't work because we're importingArgs
type from another file, right? (i.eArgs: PopoverSignature['Args'];
).@placement
arg to'bottom-start'
, since it's how most menus work like. Do you agree?