From 076c8fc925f37550cb8568a26f5602803ff0df28 Mon Sep 17 00:00:00 2001 From: marwoodandrew Date: Wed, 4 Sep 2019 12:19:06 +1000 Subject: [PATCH] [SDESK-4654] Handle the enter key in Selecting subject codes etc. (#1312) --- .../UI/Form/SelectMetaTermsInput/SelectFieldPopup.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/components/UI/Form/SelectMetaTermsInput/SelectFieldPopup.jsx b/client/components/UI/Form/SelectMetaTermsInput/SelectFieldPopup.jsx index ba1aecad9..39830c21f 100644 --- a/client/components/UI/Form/SelectMetaTermsInput/SelectFieldPopup.jsx +++ b/client/components/UI/Form/SelectMetaTermsInput/SelectFieldPopup.jsx @@ -85,11 +85,13 @@ export class SelectFieldPopup extends React.Component { if (this.props.multiLevel) { if (this.state.activeOptionIndex !== -1) { this.onSelect(this.state.filteredList[this.state.activeOptionIndex]); - } else { - this.onSelect(this.state.currentParent); + } else if (this.state.filteredList.length == 1) { + this.onSelect(this.state.filteredList[0]); } } else if (this.state.activeOptionIndex !== -1) { this.onSelect(this.state.filteredList[this.state.activeOptionIndex]); + } else if (this.state.filteredList.length == 1) { + this.onSelect(this.state.filteredList[0]); } }