From 3477d9c6e651dfb3ee0750825eb800a4e99c531e Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Thu, 10 Jul 2025 18:32:42 +0900 Subject: [PATCH 1/7] (Picklist): restore the `buttonRef` prop --- src/scripts/Picklist.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index 609caf826..0828032f6 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -173,6 +173,7 @@ export type PicklistProps = { tooltip?: ReactNode; tooltipIcon?: string; elementRef?: Ref; + buttonRef?: Ref; dropdownRef?: Ref; onValueChange?: Bivariant< ( @@ -214,6 +215,7 @@ export const Picklist: (( tooltip, tooltipIcon, elementRef: elementRef_, + buttonRef: buttonRef_, dropdownRef: dropdownRef_, onSelect, onComplete, @@ -336,6 +338,7 @@ export const Picklist: (( const elRef = useRef(null); const elementRef = useMergeRefs([elRef, elementRef_]); const comboboxElRef = useRef(null); + const buttonRef = useMergeRefs([comboboxElRef, buttonRef_]); const dropdownElRef = useRef(null); const dropdownRef = useMergeRefs([dropdownElRef, dropdownRef_]); @@ -559,7 +562,7 @@ export const Picklist: (( role='none' >
Date: Thu, 10 Jul 2025 18:41:42 +0900 Subject: [PATCH 2/7] (Picklist): normalize markups around `Icon` --- src/scripts/Picklist.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index 0828032f6..0b3e5141c 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -580,12 +580,13 @@ export const Picklist: (( > {selectedItemLabel}
- - - + {opened && (
= ({ > {selected && ( - - - + )} From 3d1e26c682b96739fe65bbacb05586a534020e4b Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 11 Jul 2025 10:38:32 +0900 Subject: [PATCH 3/7] (Picklist): restore the `icon` prop --- src/scripts/Picklist.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index 0b3e5141c..b16e89998 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -627,6 +627,7 @@ export type PicklistItemProps = { value?: string | number; selected?: boolean; disabled?: boolean; + icon?: string; children?: React.ReactNode; }; @@ -638,6 +639,7 @@ export const PicklistItem: FC = ({ selected: selected_, value, disabled, + icon, children, }) => { const { values, multiSelect, onSelect, focusedValue, optionIdPrefix } = @@ -676,14 +678,21 @@ export const PicklistItem: FC = ({ onClick={onClick} > - {selected && ( + {icon ? ( + + ) : selected ? ( - )} + ) : null} From 8309f9e994bbb04a62268d005c48da790379f517 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 11 Jul 2025 10:40:40 +0900 Subject: [PATCH 4/7] (Picklist): restore the `divider` prop --- src/scripts/Picklist.tsx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index b16e89998..36623d28e 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -628,6 +628,7 @@ export type PicklistItemProps = { selected?: boolean; disabled?: boolean; icon?: string; + divider?: 'top' | 'bottom'; children?: React.ReactNode; }; @@ -640,6 +641,7 @@ export const PicklistItem: FC = ({ value, disabled, icon, + divider, children, }) => { const { values, multiSelect, onSelect, focusedValue, optionIdPrefix } = @@ -665,8 +667,12 @@ export const PicklistItem: FC = ({ } ); - return ( -
  • + const listItemClassNames = classnames( + 'slds-listbox__item', + divider ? `slds-has-divider_${divider}-space` : undefined + ); + const mainListItem = ( +
  • = ({
  • ); + + return ( + <> + {divider === 'top' && ( +
  • + )} + {mainListItem} + {divider === 'bottom' && ( +
  • + )} + + ); }; From 9d8c62079f0b45291a89631b37b34b43a49b6c28 Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Fri, 18 Jul 2025 09:30:08 +0900 Subject: [PATCH 5/7] (Picklist): rename `buttonRef` with `inputRef` --- src/scripts/Picklist.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index 36623d28e..9f36409e2 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -173,7 +173,7 @@ export type PicklistProps = { tooltip?: ReactNode; tooltipIcon?: string; elementRef?: Ref; - buttonRef?: Ref; + inputRef?: Ref; dropdownRef?: Ref; onValueChange?: Bivariant< ( @@ -215,7 +215,7 @@ export const Picklist: (( tooltip, tooltipIcon, elementRef: elementRef_, - buttonRef: buttonRef_, + inputRef: inputRef_, dropdownRef: dropdownRef_, onSelect, onComplete, @@ -338,7 +338,7 @@ export const Picklist: (( const elRef = useRef(null); const elementRef = useMergeRefs([elRef, elementRef_]); const comboboxElRef = useRef(null); - const buttonRef = useMergeRefs([comboboxElRef, buttonRef_]); + const inputRef = useMergeRefs([comboboxElRef, inputRef_]); const dropdownElRef = useRef(null); const dropdownRef = useMergeRefs([dropdownElRef, dropdownRef_]); @@ -562,7 +562,7 @@ export const Picklist: (( role='none' >
    Date: Mon, 14 Jul 2025 10:52:54 +0900 Subject: [PATCH 6/7] (Picklist): restore the `onClick` prop --- src/scripts/Picklist.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index 9f36409e2..d5b0438ec 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -629,6 +629,7 @@ export type PicklistItemProps = { disabled?: boolean; icon?: string; divider?: 'top' | 'bottom'; + onClick?: (e: React.SyntheticEvent) => void; children?: React.ReactNode; }; @@ -642,6 +643,7 @@ export const PicklistItem: FC = ({ disabled, icon, divider, + onClick: onClick_, children, }) => { const { values, multiSelect, onSelect, focusedValue, optionIdPrefix } = @@ -650,9 +652,10 @@ export const PicklistItem: FC = ({ selected_ ?? (value != null ? values.indexOf(value) >= 0 : false); const isFocused = focusedValue === value; - const onClick = useEventCallback(() => { + const onClick = useEventCallback((e: React.SyntheticEvent) => { if (!disabled && value != null) { onSelect(value); + onClick_?.(e); } }); From 35a62a5702331e553be6aa498625cc4eb2b3896c Mon Sep 17 00:00:00 2001 From: msmx-mnakagawa Date: Tue, 15 Jul 2025 10:21:36 +0900 Subject: [PATCH 7/7] (Picklist): restore the `iconRight` prop --- src/scripts/Picklist.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/scripts/Picklist.tsx b/src/scripts/Picklist.tsx index d5b0438ec..09de07b23 100644 --- a/src/scripts/Picklist.tsx +++ b/src/scripts/Picklist.tsx @@ -628,6 +628,7 @@ export type PicklistItemProps = { selected?: boolean; disabled?: boolean; icon?: string; + iconRight?: string; divider?: 'top' | 'bottom'; onClick?: (e: React.SyntheticEvent) => void; children?: React.ReactNode; @@ -642,6 +643,7 @@ export const PicklistItem: FC = ({ value, disabled, icon, + iconRight, divider, onClick: onClick_, children, @@ -708,6 +710,16 @@ export const PicklistItem: FC = ({ {label || children} + {iconRight && ( + + + + )}
  • );