Search and Options not working together
See original GitHub issueSummary
When trying to use options
, search
and searchField
together the list is not filtered correctly.
Steps to reproduce
Ember: 2.11.0
Ember Data: 2.11.0
jQuery: 2.2.4
Ember Power Select: 1.5.0-beta.2
{{#power-select
searchEnabled=true
search=(action "search")
searchField="name"
placeholder="All"
options=locations
selected=(find-by "id" location locations)
onchange=(action "changeLocation")
as |loc|
}}
{{loc.name}}
{{/power-select}}
import Ember from 'ember';
const { run, RSVP: { Promise } } = Ember;
export default Ember.Component.extend({
location: null,
store: Ember.inject.service(),
locations: Ember.computed(function() {
return this.get('store').peekAll('location');
}),
queryLocations(name, resolve) {
return this.get('store')
.query('location', { name })
.then(resolve);
},
actions: {
changeLocation(location) {
if (!location) {
this.set('location', null);
return;
}
this.set('location', location.get('id'));
},
search(name) {
return new Promise(resolve =>
run.debounce(this, this.queryLocations, name, resolve, 500)
);
},
},
});
Expected behaviour
- Open drop down
- Observe list is populated with locations
- Begin typing in search
- Observe list begins filtering locations immediately
- AJAX request sent after debounce timeout
- Additional matching locations are added to the filtered list
Actual behaviour
- Open drop down
- Observe list is populated with locations
- Begin typing in search
- Loading message is displayed, but list is not filtered
- AJAX request sent after debounce timeout
- Additional matching locations are appended the list
- Non-matching locations are not hidden from the list
- Either
- Typing another matching character correctly filters the list
- Removing the query then re-typing correctly filters the list
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to Fix File Explorer Search Not Working in Windows 10 / 11
Fix 2 – Restart file explorer · 1. Press CTRL + SHIFT + Esc keys together to open Task manager. · 2. Now,...
Read more >Fix site display issues with Compatibility View in Internet ...
Learn how to fix website display problems using Compatibility View in Internet Explorer.
Read more >Start Menu or Taskbar Search Not Working in Windows 10/11
Go to Settings -> Search -> Searching Windows. · The “Search and Indexing Services” troubleshoot wizard should launch; · Select your problem (most...
Read more >Understand & manage your location when you search on ...
When you search on Google, like with Maps, Search or Google Assistant, your current location is used to give you more helpful results....
Read more >Fix: Windows 11 Search Menu Not Working - YouTube
In this video I will show you how to Fix: Windows 11 Search Menu Not Working. Partnerships/Business: itstechbased@outlook.com Join our ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
search
trumps over anything else.Unfortunately not, the best we got was removing the options and relying on search which wasn’t ideal.