Repository: Semantic-Org/Semantic-UI-React (JavaScript)

Issue:
Dropdown: `search` & `selection` allows disabled options to be selected
## Bug Report

### Steps

1. Create a searchable dropdown, see: [codesandbox](https://codesandbox.io/s/semantic-ui-example-yqlkk)
2. Within the options, mark one as `disabled`
3. Search in the field such that only the disabled item is displayed (in my example above, type the letters `Be` to filter to `Belgium`)
4. Blur the field with a mouse click

### Expected Result
Nothing is selected

### Actual Result
The disabled item is selected in the field

### Version
0.88.1 (also occurs on 0.80.2 where originally discovered)

### Testcase
https://codesandbox.io/s/semantic-ui-example-yqlkk

## Additional Information
This is not necessarily a bug if the developer disables `selectOnBlur`, like so:
```javascript
 <Dropdown
    placeholder="Select Country"
    fluid
    search
    selection
    selectOnBlur={false}
    options={countryOptions}
  />
```

The results of disabling select on blur can be found on this [codesandbox](https://codesandbox.io/s/semantic-ui-example-79ep2)


Discussion:
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you've completed all the fields in the issue template so we can best help.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

Confirmed that this is reproducible when searching. Triaging to `needs engineering` for now. Thank you for the note on the workaround.
I will work on this



Patch:
diff --git a/src/modules/Dropdown/Dropdown.js b/src/modules/Dropdown/Dropdown.js
index 501e81b43d..ff4530ec75 100644
--- a/src/modules/Dropdown/Dropdown.js
+++ b/src/modules/Dropdown/Dropdown.js
@@ -275,10 +275,12 @@ export default class Dropdown extends Component {
 
     const item = this.getSelectedItem(selectedIndex)
     const selectedValue = _.get(item, 'value')
+    const disabled = _.get(item, 'disabled')
 
     // prevent selecting null if there was no selected item value
     // prevent selecting duplicate items when the dropdown is closed
-    if (_.isNil(selectedValue) || !open) {
+    // prevent selecting disabled items
+    if (_.isNil(selectedValue) || !open || disabled) {
       return value
     }
 


Test patch:
diff --git a/test/specs/modules/Dropdown/Dropdown-test.js b/test/specs/modules/Dropdown/Dropdown-test.js
index 7d2b61cbbd..6aef057478 100644
--- a/test/specs/modules/Dropdown/Dropdown-test.js
+++ b/test/specs/modules/Dropdown/Dropdown-test.js
@@ -2278,6 +2278,25 @@ describe('Dropdown', () => {
 
       wrapper.should.have.state('focus', true)
     })
+
+    it('does not selected "disabled" item after blur', () => {
+      const customOptions = [
+        { key: 'foo', text: 'foo', value: 'foo' },
+        { key: 'bar', text: 'bar', value: 'bar', disabled: true },
+      ]
+
+      wrapperMount(<Dropdown options={customOptions} selection search />)
+
+      wrapper.simulate('focus')
+      dropdownMenuIsOpen()
+
+      wrapper.find('input.search').simulate('change', { target: { value: 'bar' } })
+      wrapper.find('input.search').getDOMNode().blur()
+      wrapper.simulate('blur')
+
+      dropdownMenuIsClosed()
+      wrapper.find('.item.disabled').should.have.not.className('selected')
+    })
   })
 
   describe('searchInput', () => {