From b07840db1b6dbb0c88c46990812127b0ca84b4d8 Mon Sep 17 00:00:00 2001 From: melloware Date: Wed, 24 Aug 2022 07:33:48 -0400 Subject: [PATCH] Fix #3179: Dropdown onBlur check for inputRef --- components/lib/dropdown/Dropdown.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 360dc00d88..29972c6759 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -86,15 +86,16 @@ export const Dropdown = React.memo( if (props.onBlur) { setTimeout(() => { + const currentValue = inputRef.current ? inputRef.current.value : ''; props.onBlur({ originalEvent: event.originalEvent, - value: inputRef.current.value, + value: currentValue, stopPropagation: () => {}, preventDefault: () => {}, target: { name: props.name, id: props.id, - value: inputRef.current.value + value: currentValue } }); }, 200);