diff --git a/src/Components/Common/Tooltip/Tooltip.jsx b/src/Components/Common/Tooltip/Tooltip.jsx index d1d5f39..9e92d0d 100644 --- a/src/Components/Common/Tooltip/Tooltip.jsx +++ b/src/Components/Common/Tooltip/Tooltip.jsx @@ -83,7 +83,6 @@ const Tooltip = forwardRef(({ // Merge the child's original props, with the new props provided by the trigger. ...mergeProps(child.props, eventedProps), })} - {/* */} { const formattedValue = formatValue(datakey, payload[datakey], unit, payload); const shouldDisplayTooltip = ( @@ -44,7 +45,11 @@ const NetworkCellValue = ({ delay={500} title={getTitle()} > -
+ {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */} +
{formattedValue}
@@ -53,11 +58,13 @@ const NetworkCellValue = ({ NetworkCellValue.propTypes = { datakey: PropTypes.string.isRequired, + onClick: PropTypes.func, payload: PropTypes.object, unit: PropTypes.string, }; NetworkCellValue.defaultProps = { + onClick: () => {}, payload: {}, unit: null, }; diff --git a/src/Components/NetworkTable/NetworkTableBody.jsx b/src/Components/NetworkTable/NetworkTableBody.jsx index bcbef1c..1c99158 100644 --- a/src/Components/NetworkTable/NetworkTableBody.jsx +++ b/src/Components/NetworkTable/NetworkTableBody.jsx @@ -58,6 +58,10 @@ const NetworkTableBody = ({ height }) => { }, [data, ref]); const handleReqSelect = (payload) => { + if (selectedReqIndex === payload.index) { + return; + } + actions.updateScrollToIndex(payload.index); actions.selectRequest(payload); callbacks.onRequestSelect(payload); diff --git a/src/Components/NetworkTable/NetworkTableRow.jsx b/src/Components/NetworkTable/NetworkTableRow.jsx index d5fdfa0..6cf7d71 100644 --- a/src/Components/NetworkTable/NetworkTableRow.jsx +++ b/src/Components/NetworkTable/NetworkTableRow.jsx @@ -22,9 +22,7 @@ const NetworkTableRow = ({ const { state } = useNetwork(); const showReqDetail = state.get('showReqDetail'); const { showWaterfall } = useTheme(); - const columns = getViewerFields(showReqDetail, showWaterfall); - const handleSelectRequest = () => onSelect(entry); const rowProps = { className: context( @@ -33,39 +31,36 @@ const NetworkTableRow = ({ { highlight: scrollHighlight }, ), id: ROW_ID_PREFIX + entry.index, - onClick: handleSelectRequest, + onClick: () => onSelect(entry), }; return (
- {Object.entries(columns) - .map(([datakey, { - key, - unit, - }]) => ( -
- {(key === 'waterfall' && entry.time ? ( - - ) : ( - - ))} -
- ))} + {Object.entries(columns).map(([datakey, { key, unit }]) => ( +
+ {(key === 'waterfall' && entry.time ? ( + + ) : ( + + ))} +
+ ))}
); diff --git a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap index 56af37e..256bb7e 100644 --- a/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap +++ b/tests/__tests__/Components/NetworkTable/__snapshots__/NetworkTableRow.spec.jsx.snap @@ -105,6 +105,7 @@ exports[`NetworkTableRow renders without crashing 1`] = ` >