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

[Feature Request] Autocomplete render trailing custom element functionality #2925

Open
CelloAdrian opened this issue May 1, 2024 · 2 comments
Labels
🔦 Type: Feature New feature or request

Comments

@CelloAdrian
Copy link

Is your feature request related to a problem? Please describe.

When dynamically populating autocomplete from an array, we don't have an option to render a custom element to the Autocomplete component, in this case for example a "Create New" button

Describe the solution you'd like

It would be nice to be able to render a custom element in the Autocomplete component when we specify the prop

Describe alternatives you've considered

Material UI has this functionality :
https://mui.com/material-ui/react-autocomplete/#FreeSoloCreateOption.js

Screenshots or Videos

image
image

Copy link

linear bot commented May 1, 2024

@CelloAdrian CelloAdrian changed the title [Feature Request] Autocomplete create item functionality [Feature Request] Autocomplete render trailing custom element functionality May 6, 2024
@ryo-manba
Copy link
Member

Thanks for the issue! As a workaround, you could potentially add a custom item like Add "{inputValue}" when the list of filtered items becomes empty using the onInputChange event. Additionally, you could remove any prefix from the message in the onSelectionChange event based on the key. If you try this out, please let us know how it goes!

@ryo-manba ryo-manba added the 🔦 Type: Feature New feature or request label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔦 Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants