@@ -3,6 +3,7 @@ import { SubViewDescription } from 'backbone-fractal/dist/composite-view';
3
3
import 'select2' ;
4
4
5
5
import Model from '../core/model' ;
6
+ import Collection from '../core/collection' ;
6
7
import View , { CompositeView , CollectionView } from '../core/view' ;
7
8
import { xsd , rdfs } from '../common-rdf/ns' ;
8
9
import ldChannel from '../common-rdf/radio' ;
@@ -102,7 +103,14 @@ export default class Dropdown extends CompositeView {
102
103
const criterion = applicableTo ( range . id ) ;
103
104
this . filterGroup = new OptionGroup ( {
104
105
model : groupLabels . get ( 'filter' ) ,
105
- collection : new FilteredCollection ( filters , criterion ) ,
106
+ // For some reason, TS decided to reinterpret
107
+ // `FilteredCollection`'s first parameter type as
108
+ // `Backbone.Collection<Model> and `filters` as a
109
+ // `Collection<Backbone.Model>`, which gave a lot of trouble.
110
+ // While there is no reason for TS to make these inferences in
111
+ // the first place, reaffirming that `filters` is a regular
112
+ // `Collection<Model>` does solve the issue. Damn you TS!
113
+ collection : new FilteredCollection ( filters as Collection , criterion ) ,
106
114
} ) ;
107
115
const predicates = applicablePredicates ( range ) ;
108
116
this . listenTo ( predicates , 'update' , this . restoreSelection ) ;
0 commit comments