FIX: makes typing indicator visible when possible

This commit is contained in:
Joffrey JAFFEUX 2017-11-21 18:07:10 +01:00 committed by GitHub
parent 3dfc0777df
commit 9444c31918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View File

@ -63,6 +63,9 @@ export default SelectKitComponent.extend({
return this._super() && !computedValues.includes(filter);
},
@computed
shouldDisplayFilter() { return true; },
_beforeWillComputeValues(values) {
return values.map(v => this._castInteger(v === "" ? null : v));
},

View File

@ -55,12 +55,6 @@ export default Ember.Mixin.create({
$(`.select-kit-fixed-placeholder-${this.elementId}`).remove();
},
// make sure we dont propagate a click outside component
// to avoid closing a modal containing the component for example
click(event) {
this._destroyEvent(event);
},
// use to collapse and remove focus
close(event) {
this.collapse(event);
@ -69,7 +63,13 @@ export default Ember.Mixin.create({
// force the component in a known default state
focus() {
Ember.run.schedule("afterRender", () => this.$header().focus() );
Ember.run.schedule("afterRender", () => {
if (this.$filterInput().is(":visible")) {
this.$filterInput().focus();
} else {
this.$header().focus();
}
});
},
expand(event) {

View File

@ -193,6 +193,12 @@ export default Ember.Mixin.create({
return;
},
// make sure we dont propagate a click outside component
// to avoid closing a modal containing the component for example
click(event) {
this._destroyEvent(event);
},
tabFromHeader(event) { this.didPressTab(event); },
tabFromFilter(event) { this.didPressTab(event); },