ranile / material-yew

Yew wrapper for Material Web Components
https://material-yew.rm.rs
Apache License 2.0
230 stars 35 forks source link

Provide cleaner API for `anchor` prop of Menu #6

Open ranile opened 3 years ago

ranile commented 3 years ago

Menu's anchor prop take has signature of anchor: Option<web_sys::HtmlElement>. It's clunky and difficult to use. For example, need to have HtmlElement of the element which isn't possible to obtain in view before returning. The only method of setting it right now that I know of is by using WeakComponentLink::<MatMenu>::set_anchor in after the component is rendered. We need to provide a more elegant API for this.