From 4c510a01d632ab7d0cff22bdd8b2d61896857f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Mart=C3=ADnez?= Date: Tue, 10 Aug 2021 14:36:28 +0200 Subject: [PATCH] callback function to know edit mode and hide dropdown toggle option --- lib/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 665fba2..6c93633 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,6 +27,7 @@ function SelectBox({ multiListEmptyLabelStyle, listEmptyLabelStyle, selectedItemStyle, + editStatus, listEmptyText = 'No results found', ...props }) { @@ -129,6 +130,7 @@ function SelectBox({ } const { selectIcon, + noEditable, label, inputPlaceholder = 'Select', hideInputFilter, @@ -221,9 +223,11 @@ function SelectBox({ )} - - {selectIcon ? selectIcon : } - + {noEditable ? null : + + {selectIcon ? selectIcon : } + + } {/* Options wrapper */} {showOptions && ( @@ -303,6 +307,7 @@ function SelectBox({ } function onPressShowOptions() { + editStatus ? editStatus(showOptions) : null return () => setShowOptions(!showOptions) } }