Skip to content

Commit

Permalink
lib: Support for a footer in TypeaheadSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
mvollmer authored and martinpitt committed Jan 5, 2025
1 parent f498937 commit d4eee9f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/lib/cockpit-components-typeahead-select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ SOFTWARE.
done. And there is no visual nesting going on anyway. Keeping the
options a flat list is just all around easier.
- Support for a footer.
*/

/* eslint-disable */
Expand All @@ -88,6 +90,7 @@ import {
SelectList,
SelectOptionProps,
MenuToggle,
MenuFooter,
MenuToggleElement,
TextInputGroup,
TextInputGroupMain,
Expand Down Expand Up @@ -164,6 +167,8 @@ export interface TypeaheadSelectProps extends Omit<SelectProps, 'toggle' | 'onSe
noOptionsFoundMessage?: string | ((filter: string) => string);
/** Flag indicating the select should be disabled. */
isDisabled?: boolean;
/** Optional footer */
footer?: React.ReactNode;
/** Width of the toggle. */
toggleWidth?: string;
/** Additional props passed to the toggle. */
Expand Down Expand Up @@ -208,6 +213,7 @@ export const TypeaheadSelectBase: React.FunctionComponent<TypeaheadSelectProps>
isCreateOptionOnTop = false,
createOptionMessage = "",
isDisabled = false,
footer = null,
toggleWidth,
toggleProps,
...props
Expand Down Expand Up @@ -535,6 +541,7 @@ export const TypeaheadSelectBase: React.FunctionComponent<TypeaheadSelectProps>
);
})}
</SelectList>
{ footer && <MenuFooter>{footer}</MenuFooter> }
</Select>
);
};
Expand Down

0 comments on commit d4eee9f

Please sign in to comment.