11// @flow
22
33import Icon from '@conveyal/woonerf/components/icon'
4- import React , { Component } from 'react'
4+ import clone from 'lodash/cloneDeep'
5+ import React , { Component } from 'react'
56import { DragSource , DropTarget } from 'react-dnd'
67import {
78 Checkbox ,
@@ -18,11 +19,11 @@ import * as stopStrategiesActions from '../../actions/map/stopStrategies'
1819import * as tripPatternActions from '../../actions/tripPattern'
1920import { getEntityName , getAbbreviatedStopName } from '../../util/gtfs'
2021import MinuteSecondInput from '../MinuteSecondInput'
22+ import type { Feed , Pattern , PatternStop } from '../../../types'
23+
2124import NormalizeStopTimesTip from './NormalizeStopTimesTip'
2225import PatternStopButtons from './PatternStopButtons'
2326
24- import type { Feed , Pattern , PatternStop } from '../../../types'
25-
2627type Props = {
2728 active : boolean ,
2829 activePattern : Pattern ,
@@ -326,7 +327,9 @@ class PatternStopContents extends Component<Props, State> {
326327 const { activePattern, index, updatePatternStops} = this . props
327328 const patternStops = [ ...activePattern . patternStops ]
328329
329- patternStops [ index ] [ evt . target . id ] = selectedOptionValue
330+ const newPatternStop = clone ( patternStops [ index ] )
331+ newPatternStop [ evt . target . id ] = selectedOptionValue
332+ patternStops [ index ] = newPatternStop
330333 this . setState ( { update : true } )
331334 updatePatternStops ( activePattern , patternStops )
332335 }
0 commit comments