Skip to content

support renderOption, clearable and clearButtonProps in Autocomplete#604

Merged
AnnMarieW merged 10 commits intosnehilvj:masterfrom
ihor-lazariev:master
Jun 11, 2025
Merged

support renderOption, clearable and clearButtonProps in Autocomplete#604
AnnMarieW merged 10 commits intosnehilvj:masterfrom
ihor-lazariev:master

Conversation

@ihor-lazariev
Copy link
Copy Markdown
Contributor

@ihor-lazariev ihor-lazariev commented Jun 11, 2025

  • allows to use custom format for Autocomplete data entries
  • allows to add clear button to Autocomplete
Screenshot 2025-06-11 at 22 09 22

fixes #602

@ihor-lazariev ihor-lazariev marked this pull request as ready for review June 11, 2025 13:38
Comment thread src/ts/components/core/combobox/Autocomplete.tsx
@ihor-lazariev
Copy link
Copy Markdown
Contributor Author

@AnnMarieW would you mind taking a look? :)

@AnnMarieW
Copy link
Copy Markdown
Collaborator

This looks great - Thanks! And nice test 🙂

Removing wrapperProps={{ autoComplete: 'off' }} is the right thing to do. This was also removed from Select MultiSelect and TagsInput several months ago because it has not effect.

The wrapperProps pass additional props to the root element which in this component is a div -- and autoComplete is not a valid prop for a div. That error message is helpful and I'm not sure why it doesn't show on previous builds.

Please add a an entry in changelog.

To the top, add

# Unreleased

### Added 

Then include a short description, the PR number and your Github username.

While you are there, do you mind doing me a favor and changing Unreleased (2.0.0) to just 2.0.0 Looks like I forgot to do that before the last release.

Is there anything else before we merge?

@ihor-lazariev
Copy link
Copy Markdown
Contributor Author

While you are there, do you mind doing me a favor and changing Unreleased (2.0.0) to just 2.0.0 Looks like I forgot to do that before the last release.

Updated

Is there anything else before we merge?

I'd like to try adding support for clearable and clearButtonProps, but this would be another PR. This one can be closed
Thanks!

@AnnMarieW
Copy link
Copy Markdown
Collaborator

If you would like to add clearable and clearButtonProps to this pr, it would be ok. These are simply pass-through props so it's not necessary to add tests. (You can just run an app locally to confirm)

To the import statements add:

import { __ClearButtonProps } from 'props/button';

To the Props add:

    /** Determines whether the clear button should be displayed in the right section when the component has value, `false` by default */
    clearable?: boolean;
    /** Props passed down to the clear button */
    clearButtonProps?: __ClearButtonProps;

@ihor-lazariev ihor-lazariev changed the title support renderOption in dmc.Autocomplete support renderOption, clearable and clearButtonProps in Autocomplete Jun 11, 2025
Comment thread CHANGELOG.md Outdated
Copy link
Copy Markdown
Collaborator

@AnnMarieW AnnMarieW left a comment

Choose a reason for hiding this comment

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

Congrats on your first PR in Dash Mantine Components!
Thanks again for the PR

💃

@AnnMarieW AnnMarieW merged commit 13f6c8f into snehilvj:master Jun 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug/Feature Request] renderOption not working for dmc.Autocomplete

2 participants