Skip to content

Commit

Permalink
fix(Dropdown): allow expandIcon to be null (#30339)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanboXue-Amber authored Jan 17, 2024
1 parent b56e712 commit 06421bb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: allow expandIcon to be null",
"packageName": "@fluentui/react-combobox",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type DropdownProps = ComponentProps<Partial<DropdownSlots>, 'button'> & C
// @public (undocumented)
export type DropdownSlots = {
root: NonNullable<Slot<'div'>>;
expandIcon: Slot<'span'>;
expandIcon?: Slot<'span'>;
clearButton?: Slot<'button'>;
button: NonNullable<Slot<'button'>>;
listbox?: Slot<typeof Listbox>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type DropdownSlots = {
root: NonNullable<Slot<'div'>>;

/* The dropdown arrow icon */
expandIcon: Slot<'span'>;
expandIcon?: Slot<'span'>;

/* The dropdown clear icon */
clearButton?: Slot<'button'>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const renderDropdown_unstable = (state: DropdownState, contextValues: Dro
<ComboboxContext.Provider value={contextValues.combobox}>
<state.button>
{state.button.children}
<state.expandIcon />
{state.expandIcon && <state.expandIcon />}
</state.button>
{state.clearButton && <state.clearButton />}
{state.listbox &&
Expand Down

0 comments on commit 06421bb

Please sign in to comment.