yazinsai / srt-ai

Translate SRT files to any language, using AI magic ✨
https://translatesrt.com/
193 stars 50 forks source link

"Browse for SRT file..." button doesn't work #26

Open Crypt0zauruS opened 7 months ago

Crypt0zauruS commented 7 months ago

Hi, "Browse for SRT file..." button in Form.tsx doesn't work for me. I've made it working with a small change:

I've replaced the div

`

  Browse for SRT file…

`

by this code:

`

  <input
                id="fileInput"
                type="file"
                accept=".srt"
                onChange={(e) => setFile(e.target.files![0])}
                className="absolute inset-0 opacity-0 cursor-pointer"
    />

   <button
                type="button"
                className="rounded-sm bg-[#d9d9d9] py-2 px-2"
                onClick={() => {
                  const fileInput = document.getElementById("fileInput");
                  if (fileInput) {
                    fileInput.click();
                  }
                }}
              >
                Browse for SRT file…
     </button>

` Everything works now Thank you

yazinsai commented 6 months ago

hi @Crypt0zauruS can you please confirm which OS/Browser you're using? Works on Chrome Version 121.0.6167.139 (Official Build) (arm64)

Crypt0zauruS commented 6 months ago

HI @yazinsai the button doesn't work on my Firefox 123.0 (Official Build) on MacBook Air M1 Sonoma 14.3.1, but as I said, that works with my piece of code.