Skip to content

ClearableValue is not working for me. #1507

@chobo2

Description

@chobo2

Hi

I am having problems with the little x in the select bar. I tried to leave it and I tried to disable it and both don't work.

When I hit the x it just errors out saying "null value"

      var formatTypeOptions = [
            { value: 'CSV', label: 'CSV', clearableValue: false },
            { value: 'XML', label: 'Excel', clearableValue: false }
        ];

    <Select id="formats" placeholder="choose"
                            name="formats"
                            value={this.state.format}
                            options={formatTypeOptions}
                            onChange={(event) => this.formatChange(event)}
                            />

   formatChange(event) {
        this.setState({ hide: false, format: event.value, hasErrors: false });
    }

First I set it clearableValue to false so I would think it would not show up but it does, when I click on it and fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions