Skip to content

Commit

Permalink
fix(protocol-designer): well selection modal refresh on step change (#…
Browse files Browse the repository at this point in the history
…2671)

Add the step id to the WellSelectionModal key so that changing the step causes it to rerender.
  • Loading branch information
b-cooper authored Nov 13, 2018
1 parent b6246b2 commit 941916f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import styles from '../StepEditForm.css'
import type {Dispatch} from 'redux'
import type {StepFieldName} from '../../../steplist/fieldLevel'
import type {BaseState} from '../../../types'
import type {StepIdType} from '../../../form-types'
import type { FocusHandlers } from '../index'

type SP = {
stepId: ?StepIdType,
wellSelectionLabwareKey: ?string,
}
type DP = {
Expand Down Expand Up @@ -49,8 +51,8 @@ class WellSelectionInput extends React.Component<Props> {
}

getModalKey = () => {
const {name, pipetteId, labwareId} = this.props
return `${name}${pipetteId || 'noPipette'}${labwareId || 'noLabware'}`
const {name, pipetteId, labwareId, stepId} = this.props
return `${String(stepId)}${name}${pipetteId || 'noPipette'}${labwareId || 'noLabware'}`
}
render () {
const modalKey = this.getModalKey()
Expand Down Expand Up @@ -80,6 +82,7 @@ class WellSelectionInput extends React.Component<Props> {
}

const mapStateToProps = (state: BaseState): SP => ({
stepId: steplistSelectors.getSelectedStepId(state),
wellSelectionLabwareKey: steplistSelectors.getWellSelectionLabwareKey(state),
})
const mapDispatchToProps = (dispatch: Dispatch<*>): DP => ({
Expand Down

0 comments on commit 941916f

Please sign in to comment.