Skip to content

Commit 0dcd364

Browse files
committed
Auto merge of #2037 - Turbo87:x-select, r=locks
Replace `<XSelect>` component with regular `<select>` element We've only been using `XSelect` in one specific place and v3 of the addon was causing deprecation warnings due to their use of the `this.$()` API. Since we were not using any of the more advanced features from `XSelect` it was relatively straight-forward to replace with just a regular `<select>` element. r? @locks
2 parents eb1a84f + 8e1714b commit 0dcd364

File tree

5 files changed

+16
-339
lines changed

5 files changed

+16
-339
lines changed

app/controllers/crates.js

+6
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ export default Controller.extend(PaginationMixin, {
2525
return 'Alphabetical';
2626
}
2727
}),
28+
29+
actions: {
30+
handleSelection(event) {
31+
this.set('letter', event.target.value);
32+
},
33+
},
2834
});

app/helpers/eq.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { helper } from '@ember/component/helper';
2+
3+
export function eq([a, b]) {
4+
return a === b;
5+
}
6+
7+
export default helper(eq);

app/templates/crates.hbs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
</LinkTo>
1818
{{/each}}
1919

20-
<XSelect @value={{letter}} @action={{action (mut letter)}} as |xs|>
20+
<select {{on "change" (action "handleSelection")}}>
2121
<option>Filter by the letter...</option>
2222
{{#each alphabet as |letter|}}
23-
<xs.option @value={{letter}}>{{ letter }}</xs.option>
23+
<option value={{letter}} selected={{eq letter this.letter}}>{{ letter }}</option>
2424
{{/each}}
25-
</XSelect>
25+
</select>
2626
</div>
2727

2828
<div id='results'>

package-lock.json

-335
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"ember-svg-jar": "^2.2.3",
7474
"ember-test-selectors": "^3.0.0",
7575
"ember-web-app": "^3.0.1",
76-
"emberx-select": "^3.1.1",
7776
"eslint": "^6.8.0",
7877
"eslint-config-prettier": "^6.7.0",
7978
"eslint-plugin-ember": "^7.7.2",

0 commit comments

Comments
 (0)