Skip to content

Instantly share code, notes, and snippets.

@bassettsj
Created March 14, 2016 23:53
Show Gist options
  • Save bassettsj/e23fb274cc7fcb84ba88 to your computer and use it in GitHub Desktop.
Save bassettsj/e23fb274cc7fcb84ba88 to your computer and use it in GitHub Desktop.
@autobind
onClick(e: SyntheticEvent): void {
e.preventDefault();
const elTarget = e.currentTarget;
if (elTarget instanceof HTMLElement) {
const classList = elTarget.classList;
// only allow steps that are in the past or have errors to be edited
if (classList.contains('c--past') || classList.contains('c--error')) {
const stepID = parseInt(`${elTarget.dataset.id}`, 10);
this.props.onSelectStep(stepID);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment