<commit_before>import Ember from 'ember';
import Base from '../mixins/base';
import DataAttributes from '../mixins/data-attributes';

export default Ember.Component.extend(Base, DataAttributes, {
  module: 'dropdown',
  classNames: [ 'ui', 'dropdown' ],
  tagName: 'div',

  initialize: Ember.on('didInsertElement', function() {
    var selected = this.get('selected');
    if (typeof selected !== "undefined" && selected !== null) {
      this.execute('set selected', selected);
    }

    var value = this.get('value');
    if (typeof value !== "undefined" && value !== null) {
      this.execute('set value', value);
    }
  }),

  _onChange: function(value/*, text, $element*/) {
    this.set('selected', value);
  }
});<commit_msg>Added a deprecation warning to binding to value<commit_after>import Ember from 'ember';
import Base from '../mixins/base';
import DataAttributes from '../mixins/data-attributes';

export default Ember.Component.extend(Base, DataAttributes, {
  module: 'dropdown',
  classNames: [ 'ui', 'dropdown' ],
  tagName: 'div',

  initialize: Ember.on('didInsertElement', function() {
    var selected = this.get('selected');
    if (typeof selected !== "undefined" && selected !== null) {
      this.execute('set selected', selected);
    }

    var value = this.get('value');
    if (typeof value !== "undefined" && value !== null) {
      Ember.deprecate('Bind to selected on ui-dropdown instead of value as semantic doesn\'t update the display when the value is set', false);
      this.execute('set value', value);
    }
  }),

  _onChange: function(value/*, text, $element*/) {
    this.set('selected', value);
  }
});
{'fraction_non_alphanumeric': 0.1684848484848485, 'fraction_numerical': 0.0, 'mean_word_length': 3.841642228739003, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098638', 'n_tokens_mistral': 486, 'n_tokens_neox': 477, 'n_words': 139}