I often include some onRender() JavaScript to R leaflet to extend some of the functionality.
onRender()
For example below I have added the JavaScript code: