From d274eb21e9c5b05b2f704015dda4e5195e148934 Mon Sep 17 00:00:00 2001 From: Favour Ohans Date: Sun, 14 Jul 2024 23:43:37 +0100 Subject: [PATCH] Use convert select element to an input-dropdown --- CHANGELOG.md | 2 +- .../components/inputField/InputDropdown.tsx | 50 ++++++++++++++----- src/ui/components/inputField/InputField.css | 23 +++++++++ 3 files changed, 62 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3d5f70..7c58c41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.12.0] -- Adds Multitenancy support to the dashboard +- Adds Multi-tenancy support to the dashboard ## [0.11.2] - 2024-05-23 diff --git a/src/ui/components/inputField/InputDropdown.tsx b/src/ui/components/inputField/InputDropdown.tsx index 05a9ba6..7bfab77 100644 --- a/src/ui/components/inputField/InputDropdown.tsx +++ b/src/ui/components/inputField/InputDropdown.tsx @@ -12,7 +12,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -import React, { useCallback, useState } from "react"; +import React, { useCallback, useRef, useState } from "react"; import { getImageUrl } from "../../../utils"; import TooltipContainer from "../tooltip/tooltip"; @@ -48,6 +48,8 @@ const InputDropdown: React.FC = (props) => { const [isFocused, setIsFocused] = useState(false); const [isTouched, setIsTouched] = useState(false); + const inputRef = useRef(null); + const onChange = useCallback( ( event: @@ -64,7 +66,13 @@ const InputDropdown: React.FC = (props) => { const showError = props.error && (isTouched || props.forceShowError); return ( -
+
{ + setTimeout(() => { + setIsFocused(false); + }, 100); + }}> {props.label && (
)} - -
+ + )} {showError && errorPlacement === "bottom" && (