Skip to content

Commit

Permalink
Merge pull request #6001 from martinpovolny/report_filter_page1
Browse files Browse the repository at this point in the history
Report results: Multiple fixes.
  • Loading branch information
himdel committed Aug 13, 2019
2 parents 5a4035f + 5f57362 commit 72b68f4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/javascript/components/report-data-table.jsx
Expand Up @@ -16,7 +16,7 @@ import {
import { API } from '../http_api';

const cellFormatter = value => (
<TableCell className={value.style_class}>
<TableCell style={{ cursor: 'default' }} className={value.style_class}>
{value.value}
</TableCell>
);
Expand Down Expand Up @@ -222,7 +222,12 @@ const ReportDataTable = (props) => {

const filterKeyPress = (keyEvent) => {
if (keyEvent.key === 'Enter') {
fetchReportPage(dispatch, props.reportResultId, state.sortingColumns, state.pagination, state.filter);
// navigate to page 1 when searching
const newPagination = {
...state.pagination,
page: 1,
};
fetchReportPage(dispatch, props.reportResultId, state.sortingColumns, newPagination, state.filter);
keyEvent.stopPropagation();
keyEvent.preventDefault();
}
Expand Down

0 comments on commit 72b68f4

Please sign in to comment.