Skip to content

Commit

Permalink
scroll the table while in playback to the played row
Browse files Browse the repository at this point in the history
  • Loading branch information
corevo committed Apr 11, 2018
1 parent 831a914 commit d98d25a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/selenium-ide/src/neo/components/TestRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class TestRow extends React.Component {
index: PropTypes.number,
selected: PropTypes.bool,
className: PropTypes.string,
status: PropTypes.string,
command: PropTypes.object.isRequired,
isPristine: PropTypes.bool,
select: PropTypes.func,
Expand Down Expand Up @@ -135,6 +136,8 @@ class TestRow extends React.Component {
this.props.setSectionFocus("editor", () => {
this.node.focus();
});
} else if (this.props.status === "pending") {
this.node.scrollIntoViewIfNeeded();
}
}
componentWillUnmount() {
Expand Down Expand Up @@ -205,7 +208,7 @@ class TestRow extends React.Component {

const rendered = <tr
ref={node => {return(this.node = node || this.node);}}
className={classNames(this.props.className, {"selected": this.props.selected}, {"break-point": this.props.command.isBreakpoint})}
className={classNames(this.props.className, this.props.status, {"selected": this.props.selected}, {"break-point": this.props.command.isBreakpoint})}
tabIndex={this.props.selected ? "0" : "-1"}
onContextMenu={this.props.swapCommands ? this.props.onContextMenu : null}
onClick={this.select}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class TestTable extends React.Component {
{ this.props.commands ? this.props.commands.map((command, index) => (
<TestRow
key={command.id}
className={classNames(PlaybackState.commandState.get(command.id) ? PlaybackState.commandState.get(command.id).state : "")}
status={classNames(PlaybackState.commandState.get(command.id) ? PlaybackState.commandState.get(command.id).state : "")}
selected={this.props.selectedCommand === command.id}
index={index}
command={command}
Expand Down

0 comments on commit d98d25a

Please sign in to comment.