diff --git a/web/pgadmin/static/jsx/history/query_history.jsx b/web/pgadmin/static/jsx/history/query_history.jsx index 8efe08bd9..3345b6bd1 100644 --- a/web/pgadmin/static/jsx/history/query_history.jsx +++ b/web/pgadmin/static/jsx/history/query_history.jsx @@ -57,13 +57,13 @@ export default class QueryHistory extends React.Component { refocus() { if (this.state.history.length > 0) { - this.retrieveQueryListPane().focus(); + this.retrieveSelectedQuery().parentElement.focus(); } } - retrieveQueryListPane() { + retrieveSelectedQuery() { return ReactDOM.findDOMNode(this) - .getElementsByClassName('query-history')[0]; + .getElementsByClassName('selected')[0]; } getCurrentHistoryDetail() { @@ -115,8 +115,8 @@ export default class QueryHistory extends React.Component { } navigateUpAndDown(event) { - let arrowKeys = [ARROWUP, ARROWDOWN]; - let key = event.keyCode || event.which; + const arrowKeys = [ARROWUP, ARROWDOWN]; + const key = event.keyCode || event.which; if (arrowKeys.indexOf(key) > -1) { event.preventDefault(); this.onKeyDownHandler(event); @@ -169,17 +169,18 @@ export default class QueryHistory extends React.Component { render() { return ( -
+ tabIndex={-1}>