From 95df3522a15631abc51a4295cae0ea401a8d4e1e Mon Sep 17 00:00:00 2001
From: Markus Hatvan <markus_hatvan@aon.at>
Date: Tue, 14 Sep 2021 19:58:52 +0200
Subject: feat: add eslint-plugin-unicorn (#1936)

---
 packages/forms/src/select/index.tsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'packages/forms/src/select/index.tsx')

diff --git a/packages/forms/src/select/index.tsx b/packages/forms/src/select/index.tsx
index d7479f63e..7806baa2a 100644
--- a/packages/forms/src/select/index.tsx
+++ b/packages/forms/src/select/index.tsx
@@ -187,10 +187,8 @@ class SelectComponent extends Component<IProps> {
   componentDidUpdate() {
     const { open } = this.state;
 
-    if (this.searchInputRef && this.searchInputRef.current) {
-      if (open) {
-        this.searchInputRef.current.focus();
-      }
+    if (this.searchInputRef && this.searchInputRef.current && open) {
+      this.searchInputRef.current.focus();
     }
   }
 
@@ -228,6 +226,7 @@ class SelectComponent extends Component<IProps> {
   }
 
   componentWillUnmount() {
+    // eslint-disable-next-line unicorn/no-invalid-remove-event-listener
     window.removeEventListener('keydown', this.arrowKeysHandler.bind(this));
   }
 
-- 
cgit v1.2.3-70-g09d2

