diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx')
-rw-r--r-- | server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx index 8904fc41747..8a65af22ba2 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx @@ -22,7 +22,7 @@ import * as React from 'react'; import { BranchLike } from '../../../types/branch-like'; import { Issue, LinearIssueLocation, SourceLine } from '../../../types/types'; import LocationIndex from '../../common/LocationIndex'; -import LocationMessage from '../../common/LocationMessage'; +import Tooltip from '../../controls/Tooltip'; import { highlightIssueLocations, highlightSymbol, @@ -141,15 +141,18 @@ export default class LineCode extends React.PureComponent<Props, State> { const { onLocationSelect } = this.props; const onClick = onLocationSelect ? () => onLocationSelect(index) : undefined; const ref = selected ? (node: HTMLElement | null) => (this.activeMarkerNode = node) : undefined; + return ( - <LocationIndex - key={`marker-${index}`} - leading={leading} - onClick={onClick} - selected={selected}> - <span ref={ref}>{index + 1}</span> - {message && <LocationMessage selected={true}>{message}</LocationMessage>} - </LocationIndex> + <Tooltip overlay={message} placement="top"> + <LocationIndex + key={`marker-${index}`} + leading={leading} + onClick={onClick} + selected={selected} + aria-label={message ? `${index + 1}-${message}` : index + 1}> + <span ref={ref}>{index + 1}</span> + </LocationIndex> + </Tooltip> ); } |