-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix onitem click for contextual menu with anchor item #5003
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "changes": [ | ||
| { | ||
| "packageName": "office-ui-fabric-react", | ||
| "comment": "Fix passing onclick from props for contextual anchor item", | ||
| "type": "patch" | ||
| } | ||
| ], | ||
| "packageName": "office-ui-fabric-react", | ||
| "email": "[email protected]" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,7 +71,7 @@ export class ContextualMenuAnchor extends ContextualMenuItemWrapper { | |
| aria-setsize={ totalItemCount } | ||
| aria-disabled={ isItemDisabled(item) } | ||
| style={ item.style } | ||
| onClick={ this._onItemClick } | ||
| onClick={ onItemClick ? onItemClick.bind(this, item) : undefined } | ||
|
||
| onMouseEnter={ this._onItemMouseEnter } | ||
| onMouseLeave={ this._onItemMouseLeave } | ||
| onKeyDown={ itemHasSubmenu ? this._onItemKeyDown : null } | ||
|
|
||
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.
Why do you need to set this in the test if it's not going to be used?
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.
Because the snapshot has it has a function, The actual behavior should be if we have onclick then we should invoke otherwise we shouldnt have any default method.