My problem was that I had customized the maps filter and list layout to suit my site, but when the map first is drawn or changes, the Hotspots functionality redraws all those elements and they lose their MDL-specific behaviours.
I've seen this on my other sites where I update page sections via Ajax, and I have to invoke a component handler from MDL to re-upgrade the elements after they've been re-rendered.
The trouble here was that I did not understand backbone.js, which Hotspots uses to manage its UI to know how to call the MDL component handler.
And now I do! So here's how to call any javascript, after Hotspots has completed its work of redrawing your map and associated elements:
Add this to your custom javascript:
$(function() {
// Handler for .ready() called.
var mdl_input = document.getElementById('mdl-search-div'); // my MDL input wrapper
_.extend(mdl_input, Backbone.Events); // let Backbone know its here
mdl_input.listenTo(HotspotsManager, "all", function(el) { // let my input listen to every event (could probably narrow this down to just some events)
var mdl_input = document.getElementById('mdl-search-div'); //there's probably a way to pass mdl_input into the handler but I haven't got there yet
componentHandler.upgradeElement(mdl_input, 'MaterialTextfield'); //restore MDL behaviours
});
This Hotspots component is turning out to be the best choice I could have made for this site I'm working on! Highly recommended!
Cheers
Paul