Change title for an ant design select component to something different from value

Viewed 863

In antdesign, I have a disabled select component. I'd like to set the value to foo while on hover it has an explanation why the select is disabled. I'm able to add a title to the Select options, but not for the select itself - it defaults to foo in my example. Is there something I'm overlooking in the props?

Thanks

1 Answers

I don't find this prop in API as well. But I think you can use the next trick for it

  <span title="some">
    <Select
      showSearch
      style={{ width: 200 }}
      placeholder="Select a person"
      optionFilterProp="children"
      onChange={onChange}
      onFocus={onFocus}
      onBlur={onBlur}
      onSearch={onSearch}
      filterOption={(input, option) =>
        option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
      }
    >
      <Option value="jack" title="jack">
        Jack
      </Option>
      <Option value="lucy" title="ly">
        Lucy
      </Option>
      <Option value="tom">Tom</Option>
    </Select>
  </span>
Related