Skip to content

Commit 270b8f2

Browse files
authored
Merge pull request #363 from tweettypography/contextbar-link
Update the PropType of ContextBar links
2 parents 70ea11b + ec32198 commit 270b8f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/context-bar/link.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const ContextBarLink = (props) => {
4343
function handleClick (event) {
4444
if (isFunction(onClick)) {
4545
EventUtil.trap(event);
46+
47+
event.href = this.props.href;
4648
onClick(event);
4749
}
4850
}
@@ -77,9 +79,9 @@ ContextBarLink.propTypes = {
7779
*/
7880
label: PropTypes.string,
7981
/**
80-
* Function triggered when link is clicked. If set, `href` will be ignored.
82+
* `function (event)` - fires when the link is clicked. If set, `href` will be ignored, but includes the `href` of the link in the event object.
8183
*/
82-
onClick: PropTypes.string
84+
onClick: PropTypes.func
8385
};
8486

8587
module.exports = ContextBarLink;

0 commit comments

Comments
 (0)