Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(autocomplete): type for 'title' prop in AutocompleteSection #3959

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {DividerProps} from "@nextui-org/divider";

import {ListboxItemProps} from "../listbox-item";

export interface ListboxSectionBaseProps<T extends object = {}> extends SectionProps<"ul", T> {
export interface ListboxSectionBaseProps<T extends object = Record<string, unknown>>
extends SectionProps<"ul", T, "children" | "title"> {
/**
* The listbox section classNames.
*/
Expand Down
7 changes: 5 additions & 2 deletions packages/utilities/aria-utils/src/collections/section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ import {HTMLNextUIProps, As} from "@nextui-org/system";
* A modified version of the SectionProps from @react-types/shared, with the addition of the NextUI props.
*
*/
export type SectionProps<Type extends As = "div", T extends object = {}> = BaseSectionProps<T> &
Omit<HTMLNextUIProps<Type>, "children">;
export type SectionProps<
Type extends As = "div",
T extends object = {},
wingkwong marked this conversation as resolved.
Show resolved Hide resolved
OmitKeys extends string = "children" | "title",
> = BaseSectionProps<T> & Omit<HTMLNextUIProps<Type>, OmitKeys>;
Comment on lines +9 to +13
Copy link
Member

@ryo-manba ryo-manba Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export type SectionProps<
Type extends As = "div",
T extends object = {},
OmitKeys extends string = "children" | "title",
> = BaseSectionProps<T> & Omit<HTMLNextUIProps<Type>, OmitKeys>;
export type SectionProps<Type extends As = "div", T extends object = {}> = BaseSectionProps<T> &
Omit<HTMLNextUIProps<Type>, "children" | "title">;

It would be better if the title of BaseSectionProps is used.
https://github.com/adobe/react-spectrum/blob/07431f4b1809bc2b1b015149737e08db60d5c332/packages/%40react-types/shared/src/collections.d.ts#L44-L45