Skip to content

Commit

Permalink
fix(app): do not call direction control handlers if disabled (#13205)
Browse files Browse the repository at this point in the history
closes RQA-1162
  • Loading branch information
shlokamin authored Aug 1, 2023
1 parent 30c54da commit 441bb40
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions app/src/molecules/JogControls/DirectionControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,16 @@ export function DirectionControl(props: DirectionControlProps): JSX.Element {
handlers={[
...CONTROLS_CONTENTS_BY_PLANE.vertical.controls,
...CONTROLS_CONTENTS_BY_PLANE.horizontal.controls,
].map(({ keyName, shiftKey, axis, sign }) => ({
key: keyName,
shiftKey,
onPress: () => {
setCurrentPlane(shiftKey ? 'vertical' : 'horizontal')
jog(axis, sign, stepSize)
},
}))}
]
.filter(control => !control.disabled)
.map(({ keyName, shiftKey, axis, sign }) => ({
key: keyName,
shiftKey,
onPress: () => {
setCurrentPlane(shiftKey ? 'vertical' : 'horizontal')
jog(axis, sign, stepSize)
},
}))}
>
<ArrowKeys plane={currentPlane} jog={jog} stepSize={stepSize} />
</HandleKeypress>
Expand Down

0 comments on commit 441bb40

Please sign in to comment.