Skip to content

Commit

Permalink
Merge pull request #62 from btecu/burebista
Browse files Browse the repository at this point in the history
Ember.js 4 Fixes
  • Loading branch information
btecu authored Mar 10, 2023
2 parents 42e003e + c656f03 commit 4f3d4fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
23 changes: 4 additions & 19 deletions addon/components/x-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { isPresent, isBlank } from '@ember/utils';

import layout from '../templates/components/x-select';

const isEdgeIe = typeof StyleMedia !== 'undefined';

export default Component.extend(Evented, {
layout,
classNames: ['ember-select'],
Expand Down Expand Up @@ -46,9 +44,9 @@ export default Component.extend(Evented, {
multiple: bool('values'),
shouldFilter: or('isDirty', 'multiple', 'hasChanged'),

input: computed(function() {
get input() {
return document.querySelector(`#${this.elementId} input`);
}),
},

hasChanged: computed('token', 'value', function() {
let token = this.get('token');
Expand Down Expand Up @@ -127,18 +125,6 @@ export default Component.extend(Evented, {
},

change(query) {
/* IE10+ Triggers an input event when focus changes on
* an input element if the element has a placeholder.
* https://connect.microsoft.com/IE/feedback/details/810538/
*/
if (document.documentMode) {
let isDirty = this.get('isDirty');
let oldValue = this.get('oldValue') || '';
if (!isDirty && oldValue === query) {
return;
}
}

this.setProperties({
isDirty: true,
token: query
Expand Down Expand Up @@ -257,9 +243,8 @@ export default Component.extend(Evented, {
this.set('isDirty', false);
this.setOption(option, selected, notify);

/* Blur on selection when single
* IE & Edge do not run the events in proper order */
if (!this.get('multiple') && !isEdgeIe) {
// Blur on selection when single
if (!this.get('multiple')) {
this.get('input').blur();
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-select",
"version": "0.8.4",
"version": "0.8.5",
"description": "Select component",
"keywords": [
"ember-addon",
Expand Down

0 comments on commit 4f3d4fc

Please sign in to comment.