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

[Autocomplete][base-ui] Added ref to getInputProps return value #38919

Merged
merged 3 commits into from
Sep 14, 2023
Merged

[Autocomplete][base-ui] Added ref to getInputProps return value #38919

merged 3 commits into from
Sep 14, 2023

Conversation

DarhkVoyd
Copy link
Contributor

@DarhkVoyd DarhkVoyd commented Sep 11, 2023

The type of the UseAutocompleteReturnValue.getInputProps (in packages\mui-base\src\useAutocomplete\useAutocomplete.d.ts) needed to be extended and include the ref: React.Ref field.

Closes #36552

@mui-bot
Copy link

mui-bot commented Sep 11, 2023

Netlify deploy preview

https://deploy-preview-38919--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 0f3d1f9

@DarhkVoyd DarhkVoyd changed the title useAutocomplete: extended getInputProps with React.Ref. Issue 36552 [base-ui]: extended getInputProps with React.Ref in useAutocomplete Sep 11, 2023
@DarhkVoyd
Copy link
Contributor Author

@michaldudak @sai6855 can you please help me out, why my 3 checks failed?

@michaldudak
Copy link
Member

@DarhkVoyd The test_static fails because you did not run yarn docs:api. See the Contributing doc for required steps when submitting a PR.
As for the test_types, it seems that your change has already helped find issues in our demos :)
The docs\data\base\components\autocomplete\AutocompleteIntroduction\system\index.tsx and docs\data\base\components\autocomplete\AutocompleteIntroduction\tailwind\index.tsx incorrectly set their input refs (as getInputProps override whatever is set before). Since the demos work fine, it seems that setting the refs manually is not needed, so you can delete the offending lines.
Make sure to run yarn docs:typescript:formatted afterward.

@michaldudak michaldudak added component: autocomplete This is the name of the generic UI component, not the React module! typescript labels Sep 11, 2023
@DarhkVoyd
Copy link
Contributor Author

@michaldudak I have made necessary changes.

Copy link
Member

@michaldudak michaldudak left a comment

Choose a reason for hiding this comment

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

Looks good! It's a great first PR!

@DarhkVoyd
Copy link
Contributor Author

DarhkVoyd commented Sep 11, 2023

@michaldudak can you please guide me what's next? I would like to do more, where can I start?

@michaldudak michaldudak changed the title [base-ui]: extended getInputProps with React.Ref in useAutocomplete [Autocomplete][base-ui] Added ref to getInputProps return value Sep 14, 2023
@michaldudak michaldudak merged commit 1f7f2b2 into mui:master Sep 14, 2023
8 checks passed
@michaldudak
Copy link
Member

@DarhkVoyd feel free to browse the issues. We've got the good first issue and ready to take labels you can check out first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: autocomplete This is the name of the generic UI component, not the React module! typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Autocomplete] Type error of getInputProps()
3 participants