diff --git a/README.md b/README.md index 0a9d3aef4f..080e3c00cd 100644 --- a/README.md +++ b/README.md @@ -1185,7 +1185,7 @@ To reduce the time for info panel data to appear, data can be prefetched. | `infoPanel[*].prefetchObjects` | Number | yes | `0` | `2` | Number of next rows to prefetch when browsing sequential rows. For example, `2` means the next 2 rows will be fetched in advance. | | `infoPanel[*].prefetchStale` | Number | yes | `0` | `10` | Duration in seconds after which prefetched data is discarded as stale. | -Prefetching is particularly useful when navigating through lists of objects. To optimize performance and avoid unnecessary data loading, prefetching is triggered only after the user has moved through 3 consecutive rows using the keyboard down-arrow key. +Prefetching is particularly useful when navigating through lists of objects. To optimize performance and avoid unnecessary data loading, prefetching is triggered only after the user has moved through 3 consecutive rows using the keyboard down-arrow key or by mouse click. ### Freeze Columns diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index a020879efc..ff054ed9cb 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -567,10 +567,6 @@ export default class BrowserCell extends Component { current, onEditChange, setCopyableValue, - selectedObjectId, - setSelectedObjectId, - callCloudFunction, - isPanelVisible, onPointerCmdClick, row, col, @@ -580,7 +576,6 @@ export default class BrowserCell extends Component { markRequiredFieldRow, handleCellClick, selectedCells, - setShowAggregatedData, } = this.props; const classes = [...this.state.classes]; @@ -653,18 +648,7 @@ export default class BrowserCell extends Component { onPointerCmdClick(value); } else { setCopyableValue(hidden ? undefined : this.copyableValue); - if (selectedObjectId !== this.props.objectId) { - setShowAggregatedData(true); - setSelectedObjectId(this.props.objectId); - if ( - this.props.objectId && - isPanelVisible && - ((e.shiftKey && !this.props.firstSelectedCell) || !e.shiftKey) - ) { - callCloudFunction(this.props.objectId, this.props.className, this.props.appId); - } - } - handleCellClick(e, row, col); + handleCellClick(e, row, col, this.props.objectId); } }} onDoubleClick={() => { diff --git a/src/dashboard/Data/Browser/DataBrowser.react.js b/src/dashboard/Data/Browser/DataBrowser.react.js index c6b1794301..5fda24e448 100644 --- a/src/dashboard/Data/Browser/DataBrowser.react.js +++ b/src/dashboard/Data/Browser/DataBrowser.react.js @@ -758,10 +758,26 @@ export default class DataBrowser extends React.Component { }); } - handleCellClick(event, row, col) { + handleCellClick(event, row, col, objectId) { const { firstSelectedCell } = this.state; const clickedCellKey = `${row}-${col}`; + if (this.state.selectedObjectId !== objectId) { + this.setShowAggregatedData(true); + this.setSelectedObjectId(objectId); + if ( + objectId && + this.state.isPanelVisible && + ((event.shiftKey && !firstSelectedCell) || !event.shiftKey) + ) { + this.handleCallCloudFunction( + objectId, + this.props.className, + this.props.app.applicationId + ); + } + } + if (event.shiftKey && firstSelectedCell) { const [firstRow, firstCol] = firstSelectedCell.split('-').map(Number); const [lastRow, lastCol] = clickedCellKey.split('-').map(Number);