1- L . U . Importer = L . Class . extend ( {
1+ U . Importer = L . Class . extend ( {
22 initialize : function ( map ) {
33 this . map = map
44 this . presets = map . options . importPresets
@@ -27,7 +27,7 @@ L.U.Importer = L.Class.extend({
2727 const noPreset = L . DomUtil . create ( 'option' , '' , element )
2828 noPreset . value = noPreset . textContent = L . _ ( 'Choose a preset' )
2929 for ( const preset of this . presets ) {
30- option = L . DomUtil . create ( 'option' , '' , presetSelect )
30+ option = L . DomUtil . create ( 'option' , '' , this . presetSelect )
3131 option . value = preset . url
3232 option . textContent = preset . label
3333 }
@@ -39,6 +39,7 @@ L.U.Importer = L.Class.extend({
3939 this . form = template . content . firstElementChild . cloneNode ( true )
4040 this . presetSelect = this . form . querySelector ( '[name="preset-select"]' )
4141 this . fileInput = this . form . querySelector ( '[name="file-input"]' )
42+ this . map . ui . once ( 'panel:closed' , ( ) => ( this . fileInput . value = null ) )
4243 this . typeLabel = this . form . querySelector ( '#type-label' )
4344 const helpButton = this . typeLabel . querySelector ( 'button' )
4445 this . map . help . button ( this . typeLabel , 'importFormats' , '' , helpButton )
0 commit comments