Skip to content

Commit 3603f30

Browse files
authored
Merge pull request #872 from yoichi/cancel-encoder-click-operation
Call onClickCancel (not onClickCancelForEncoder) for click operation
2 parents 90b618c + 54659f3 commit 3603f30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/configure/keydiff/Keydiff.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export default class Keydiff extends React.Component<KeydiffProps, {}> {
2929
const origKey: Key = genKey(origin, labelLang);
3030
const dstKey: Key = genKey(destination, labelLang);
3131

32-
const isEncoder = KeyModel.isEncoder(this.props.selectedEncoderId!);
32+
const forEncoder =
33+
KeyModel.isEncoder(this.props.selectedEncoderId!) &&
34+
this.props.selectedKeySwitchOperation !== 'click';
3335

3436
return (
3537
<div className="diff-frame">
@@ -47,7 +49,7 @@ export default class Keydiff extends React.Component<KeydiffProps, {}> {
4749
color="secondary"
4850
startIcon={<Clear />}
4951
onClick={
50-
isEncoder
52+
forEncoder
5153
? this.props.onClickCancelForEncoder!.bind(
5254
this,
5355
this.props.selectedLayer!,

0 commit comments

Comments
 (0)