@@ -93,7 +93,9 @@ Behind the scenes, it is running [pymsi](https://github.com/nightlark/pymsi/) us
9393
9494 .file-input-container {
9595 position : relative ;
96- display : inline-block ;
96+ display : inline-flex ;
97+ width : 100% ;
98+ max-width : 320px ;
9799 }
98100
99101 .file-input-container.dragover .file-input-label {
@@ -115,8 +117,9 @@ Behind the scenes, it is running [pymsi](https://github.com/nightlark/pymsi/) us
115117 }
116118
117119 .file-input-label {
118- display : inline- flex ;
120+ display : flex ;
119121 align-items : center ;
122+ justify-content : center ;
120123 gap : 0.5rem ;
121124 padding : 0.75rem 1.5rem ;
122125 background : #007acc ;
@@ -129,6 +132,11 @@ Behind the scenes, it is running [pymsi](https://github.com/nightlark/pymsi/) us
129132 box-shadow : none ;
130133 position : relative ;
131134 z-index : 1 ;
135+ width : 100% ;
136+ min-width : 200px ;
137+ min-height : 44px ;
138+ text-align : center ;
139+ user-select : none ;
132140 }
133141
134142 .file-input-label :hover ,
@@ -256,9 +264,10 @@ Behind the scenes, it is running [pymsi](https://github.com/nightlark/pymsi/) us
256264// filepath: pymsi/docs/msi_viewer.md (inline script)
257265document .addEventListener (' DOMContentLoaded' , function () {
258266 var fileInputContainer = document .querySelector (' .file-input-container' );
259- if (! fileInputContainer) return ;
267+ var fileInput = document .getElementById (' msi-file-input' );
268+ if (! fileInputContainer || ! fileInput) return ;
260269
261- // Highlight on drag over
270+ // Make the label and container clickable and droppable everywhere
262271 fileInputContainer .addEventListener (' dragenter' , function (e ) {
263272 e .preventDefault ();
264273 fileInputContainer .classList .add (' dragover' );
@@ -272,7 +281,15 @@ document.addEventListener('DOMContentLoaded', function () {
272281 fileInputContainer .classList .remove (' dragover' );
273282 });
274283 fileInputContainer .addEventListener (' drop' , function (e ) {
284+ e .preventDefault ();
275285 fileInputContainer .classList .remove (' dragover' );
286+ // If files are dropped, set them on the input and trigger change
287+ if (e .dataTransfer && e .dataTransfer .files && e .dataTransfer .files .length > 0 ) {
288+ fileInput .files = e .dataTransfer .files ;
289+ // Trigger change event for compatibility
290+ var event = new Event (' change' , { bubbles: true });
291+ fileInput .dispatchEvent (event );
292+ }
276293 });
277294});
278295</script >
0 commit comments