From eba2e740af57444e1a757a05bb842565e192429c Mon Sep 17 00:00:00 2001 From: Regi Date: Sun, 23 Oct 2022 18:48:19 +0200 Subject: [PATCH] dropdown --- Parts/DropDown.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Parts/DropDown.js b/Parts/DropDown.js index 55bc684..4779012 100644 --- a/Parts/DropDown.js +++ b/Parts/DropDown.js @@ -104,13 +104,18 @@ let Dropdown = React.forwardRef(({ children, dropdownCss, onValueChanged, button }); export default Dropdown; -export function DropdownMenu({ children, fallback, notSelectedOne = true, value, onChange, ...props }) { +export function DropdownMenu({ children, fallback, button, notSelectedOne = true, value, onChange, ...props }) { let ref = useRef() let btn = fallback ?? ""; if (children && children.length > 0) btn = children[value > children.length ? 0 : value] + if(button != null) + { + btn = button(btn, value > children.length ? 0 : value); + } + return <> {