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 AutocompleteInput erases input while typing #7173

Merged
merged 2 commits into from Feb 1, 2022

Conversation

WiXSL
Copy link
Contributor

@WiXSL WiXSL commented Feb 1, 2022

Having a AutocompleteInput with an optionText being set to a field that is not of type string throws an internal error

<ReferenceInput
    label={'Product'}
    source={'category_id'}
    reference={'products'}
>

{ /* record:
{ 
    id: 7, // =>  type is number
    name: 'Washed jacket', 
    category_id: 5
}
 */ }
    <AutocompleteInput optionText="id" /> /* While typeing, the input gets cleared */
</ReferenceInput>

This attempts to fix optionText of type string when the data type is not a string but it doesn't when optionText is of type Function.

May be related to #6214

@WiXSL WiXSL added the WIP Work In Progress label Feb 1, 2022
@fzaninotto fzaninotto merged commit b10cc81 into master Feb 1, 2022
@fzaninotto fzaninotto deleted the fix-usechoices-type branch February 1, 2022 15:46
@fzaninotto fzaninotto added this to the v3.19.8 milestone Feb 1, 2022
@WiXSL WiXSL removed the WIP Work In Progress label Feb 1, 2022
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.

None yet

3 participants