From 6e226edf441dc3a0863f3083e490dc6c48a70984 Mon Sep 17 00:00:00 2001 From: AXeL-dev Date: Wed, 25 Sep 2024 19:48:26 +0100 Subject: [PATCH] fix(#103): register the onKeyDown event under the dialog container instead of the RadioGroup --- src/components/Blocked/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Blocked/index.jsx b/src/components/Blocked/index.jsx index f68954d..1bd12d0 100644 --- a/src/components/Blocked/index.jsx +++ b/src/components/Blocked/index.jsx @@ -206,6 +206,12 @@ export class Blocked extends Component { width={400} containerProps={{ className: 'unblock-dialog', + // Handle ENTER keypress and close dialog + onKeyDown: (event) => { + if (event.key === 'Enter') { + this.unblock(); + } + } }} > @@ -218,12 +224,6 @@ export class Blocked extends Component { selected: event.target.value, }) } - // Only Key Down event listener was added, to handle ENTER keypress and close dialog - onKeyDown={(event) => { - if (event.key === 'Enter') { - this.unblock(); - } - }} /> {this.state.unblockDialog.requirePassword ? (