acrool / acrool-react-dropdown

Drop-down menu with rich functions, including search/groups options/avatar/multi for Reactjs
https://acrool-react-dropdown.pages.dev/
MIT License
8 stars 0 forks source link

Added customizable Option text content #9

Open imagine10255 opened 1 week ago

imagine10255 commented 1 week ago

Added customizable Option text content

Through customization, more usage scenarios can be obtained, allowing the openness of the suite to provide greater space

It is expected to be changed to

interface IDropdownOption<T>  {
    value: T
    text: string|ReactNode
    searchTags?: string[]
    avatarUrl?: string
    color?: string
}

text plus the ReactNode type, where searchTags is because ReactNode cannot search. At the same time, I thought that I could add a searchTags as keyword content that is not displayed on the screen.

imagine10255 commented 1 week ago

release test v3.0.20-alpha.0

imagine10255 commented 1 week ago

nodeText has error

Uncaught TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property '_context' -> object with constructor 'Object'
    --- property 'Provider' closes the circle
    at JSON.stringify (<anonymous>)
    at Dropdown (Dropdown.tsx:92:82)
    at renderWithHooks (chunk-6VWAHX6D.js?v=4aaea234:11548:26)
    at mountIndeterminateComponent (chunk-6VWAHX6D.js?v=4aaea234:14926:21)
    at beginWork (chunk-6VWAHX6D.js?v=4aaea234:15914:22)
    at beginWork$1 (chunk-6VWAHX6D.js?v=4aaea234:19753:22)
    at performUnitOfWork (chunk-6VWAHX6D.js?v=4aaea234:19198:20)
    at workLoopSync (chunk-6VWAHX6D.js?v=4aaea234:19137:13)
    at renderRootSync (chunk-6VWAHX6D.js?v=4aaea234:19116:15)
    at recoverFromConcurrentError (chunk-6VWAHX6D.js?v=4aaea234:18736:28)