Skip to content

Commit 6e226ed

Browse files
committed
fix(#103): register the onKeyDown event under the dialog container instead of the RadioGroup
1 parent cd9e837 commit 6e226ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/Blocked/index.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ export class Blocked extends Component {
206206
width={400}
207207
containerProps={{
208208
className: 'unblock-dialog',
209+
// Handle ENTER keypress and close dialog
210+
onKeyDown: (event) => {
211+
if (event.key === 'Enter') {
212+
this.unblock();
213+
}
214+
}
209215
}}
210216
>
211217
<Pane width="95%" margin="auto">
@@ -218,12 +224,6 @@ export class Blocked extends Component {
218224
selected: event.target.value,
219225
})
220226
}
221-
// Only Key Down event listener was added, to handle ENTER keypress and close dialog
222-
onKeyDown={(event) => {
223-
if (event.key === 'Enter') {
224-
this.unblock();
225-
}
226-
}}
227227
/>
228228
{this.state.unblockDialog.requirePassword ? (
229229
<PasswordPrompt

0 commit comments

Comments
 (0)