FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(Table): Fix the ActionColumn to allow a link in the actions menu by tlabaj · Pull Request #3402 · patternfly/patternfly-react · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) .tsx  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
    • ActionsColumn.tsx
    • Table.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ export class ActionsColumn extends React.Component<ActionsColumnProps, ActionsCo
| undefined
): void => {
const { rowData, extraData } = this.props;
event.preventDefault();
// tslint:disable-next-line:no-unused-expression
onClick && onClick(event as React.MouseEvent, extraData && extraData.rowIndex, rowData, extraData);
// Only prevent default if onClick is provided. This allows href support.
if (onClick) {
event.preventDefault();
// tslint:disable-next-line:no-unused-expression
onClick(event as React.MouseEvent, extraData && extraData.rowIndex, rowData, extraData);
}
this.setState(prevState => ({
isOpen: !prevState.isOpen
}));
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,7 @@ class SimpleActionsTable extends React.Component {
onClick: (event, rowId, rowData, extra) => console.log('clicked on Some action, on row: ', rowId)
},
{
title: <div>Another action</div>,
onClick: (event, rowId, rowData, extra) => console.log('clicked on Another action, on row: ', rowId)
title: <a href="https://www.patternfly.org">Link action</a>
},
{
isSeparator: true
Expand Down

Back | FazBrowse Home | New Git URL