Skip to content
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

Expose show(),hide() and toggle() in props of ContextMenu #113

Closed
kooa opened this issue Sep 22, 2017 · 2 comments
Closed

Expose show(),hide() and toggle() in props of ContextMenu #113

kooa opened this issue Sep 22, 2017 · 2 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@kooa
Copy link

kooa commented Sep 22, 2017

Hi,
Is it possible to have onshow , onhide and ontoggle in the props of ContextMenu component ?
triggered when functions show(), hide() and toggle() are called.
Something like
this.props.onshow();
which i can use in my parent component.
I need them to dynamically control the content of my contextMenu.
Thank you

@cagataycivici cagataycivici self-assigned this Oct 16, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Oct 16, 2017
@cagataycivici cagataycivici modified the milestone: 1.1.0 Oct 16, 2017
@cagataycivici
Copy link
Member

They are already exposed;

<ContextMenu model={items} ref={el => this.menu = el} />
<Button label="Show" icon="fa fa-list" onClick={(event) => this.menu.toggle(event)}/>

@raDiesle
Copy link

Can you provide a specific example.

In my case, I neigher see onShow and onHide on ref, nor on props.

const ref = useRef();
useEffect(() => {
console.log(ref);
}, [ref.current]);
return (


<PanelMenu
className={css.userProfileMenu}
model={useUserProfileMenuConfig()}
popup

    ref={ref}
  />
</div>

);
{current: PanelMenu}
current: PanelMenu
context: {}
props: {className: "UserProfileMenu_userProfileMenu__2TvMY", model: Array(1), popup: true, id: null, style: null, …}
refs: {}
state: {activeItem: null}
updater: {isMounted: ƒ, enqueueSetState: ƒ, enqueueReplaceState: ƒ, enqueueForceUpdate: ƒ}
_reactInternalFiber: FiberNode {tag: 1, key: null, stateNode: PanelMenu, elementType: ƒ, type: ƒ, …}
_reactInternalInstance: {_processChildContext: ƒ}
isMounted: (...)
replaceState: (...)
proto: Component
proto: Object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

3 participants