From ee4a2d1620510c1ed48b6cc573e9d59fd575d415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Wed, 24 Apr 2024 19:04:02 +0800 Subject: [PATCH] fix(dropdown): disable overlay visible when options length is 0 (#2860) --- src/dropdown/Dropdown.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dropdown/Dropdown.tsx b/src/dropdown/Dropdown.tsx index 3924f22a2..e5804da67 100644 --- a/src/dropdown/Dropdown.tsx +++ b/src/dropdown/Dropdown.tsx @@ -48,7 +48,7 @@ const Dropdown: React.FC & { }; const handleVisibleChange = (visible: boolean, context: PopupVisibleChangeContext) => { - if (disabled) return; + if (disabled || !options.length) return; togglePopupVisible(visible); popupProps?.onVisibleChange?.(visible, context); };