diff options
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js index 558c80219d4..e5e5a3cbb17 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js @@ -29,9 +29,14 @@ const ComponentCell = ({ component, isSelected, onClick }) => { 'selected': isSelected }); - const handleClick = (e) => { - e.preventDefault(); - onClick(); + const handleClick = e => { + const isLeftClickEvent = e.button === 0; + const isModifiedEvent = !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey); + + if (isLeftClickEvent && !isModifiedEvent) { + e.preventDefault(); + onClick(); + } }; const { head, tail } = splitPath(component.path || component.name); @@ -54,7 +59,7 @@ const ComponentCell = ({ component, isSelected, onClick }) => { <a id={'component-measures-component-link-' + component.key} className={linkClassName} - href="#" + href={getComponentUrl(component.key)} onClick={handleClick}> {inner} </a> |