diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-08-20 12:49:49 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-08-20 20:08:13 +0200 |
commit | 0c091475df093311916c79104098f67fdfcf4d4c (patch) | |
tree | 4f583213137fff5932503eb064a097cddbfca4d2 /app | |
parent | f4d28ccfa3f9fd38a6d219fcde2d1a8bfcf6b306 (diff) |
Make non-link ColumnLinks behave as links
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/flavours/glitch/features/ui/components/column_link.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/column_link.js b/app/javascript/flavours/glitch/features/ui/components/column_link.js index b058aa963..1b6d7d09e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_link.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_link.js @@ -22,8 +22,13 @@ const ColumnLink = ({ icon, text, to, onClick, href, method, badge }) => { </Link> ); } else { + const handleOnClick = (e) => { + e.preventDefault(); + e.stopPropagation(); + return onClick(e); + } return ( - <a onClick={onClick} className='column-link' role='button' tabIndex='0' data-method={method}> + <a href='#' onClick={onClick && handleOnClick} className='column-link' tabIndex='0'> <i className={`fa fa-fw fa-${icon} column-link__icon`} /> {text} {badgeElement} |