As a interim hack, we simply adjust the styling of the select element and do not use the Materialize select plugin.
The TODO is to figure out how best to initialize the Materialize plugin in the normal Instantsearch flow.
Have attempted initializing via a partial custom widget, but that simply renders another widget which has no interactivity with Instantsearch.
search.addWidget({
render: function(options) {
$('select').material_select();
}
});
search.addWidget(
{
init: function(options) {
$('select').material_select();
}
},
instantsearch.widgets.sortBySelector({
container: '#ais-widget-sort-by',
cssClasses: {
root: 'input-field'
},
indices: [
{name: 'demo', label: 'Most relevant'},
{name: 'demo_amount_desc', label: 'Grant size'},
]
})
);