Skip to content

getOptionDisabled is not documented #11299

Description

@Aikain

I have a situation where I want to display an option in an <AutocompleteInput> as disabled, so that I can let the user know that it exists but does not meet the requirements. For this purpose, it works well enough to simply disable the option and use helperText to explain why it cannot be selected.

<ReferenceInput source='sender.id' reference='staff'>
    <AutocompleteInput<StaffList>
        label='resources.message.fields.sender'
        helperText='resources.message.helperText.sender'
        getOptionDisabled={(record) => !record.email}
    />
</ReferenceInput>

That getOptionDisabled seems to work, but I couldn't find any mention of it in the documentation. Has this been left out of the documentation, or is it not supposed to be used this way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions