Watching the value in a FileInput widget does not work with Google Chrome

I want to make a widget with the FileInput and watch the value. What I want to do is the following step.

  1. Select a file (example.txt) in the FileInput widget and show a random string
  2. Modify the content of the file.
  3. Select the same file (example.txt) in the FileInput again (FileInput.value must be changed at this point after sending the content to the server) and show a different random string

Firefox (or Gecko) behaves as I expected, but WebKit- and Blink-based browsers (e.g., Chrome, Brave, Safari, Vivaldi) do not update the text at the 3rd step.

I’m wondering if any modifications of the code can fix the issue.

Here is an example code.

import secrets
import panel as pn
import param


class WatchFileInput(param.Parameterized):
    file_input = pn.widgets.FileInput(multiple=False)
    text = pn.pane.Markdown()
    pane = pn.Column(file_input, text)

    @pn.depends("file_input.value", watch=True)
    def generate_random_string(self):
        self.text.object = f"{secrets.token_hex(8)}"


I’m using Panel 1.2.3 with Python 3.11.5 on macOS 14.0.