Are you able to replicate the bug in the demo site?
It looks like no. I am not sure that the demo site has 0.41.0 yet
Description
There's an issue with the fileInputUpdatePath implementation that prevents it from working with file inputs that exist when the page initially loads. This was introduced in #846.
Currently, the MutationObserver only watches for newly added elements (childList mutations) and attaches the change event handler to file inputs after they're dynamically added to the DOM. However, this means any file inputs that are part of the initial page HTML are missed completely.
Suggested Fix
We should modify the function to:
Immediately attach handlers to existing file inputs when the function is called
Keep the MutationObserver for handling dynamically added inputs
Versions: Django 5 + Unfold 0.41 + latest Chrome
Are you able to replicate the bug in the demo site? It looks like no. I am not sure that the demo site has 0.41.0 yet
Description
There's an issue with the
fileInputUpdatePath
implementation that prevents it from working with file inputs that exist when the page initially loads. This was introduced in #846.Currently, the MutationObserver only watches for newly added elements (
childList
mutations) and attaches the change event handler to file inputs after they're dynamically added to the DOM. However, this means any file inputs that are part of the initial page HTML are missed completely.Suggested Fix
We should modify the function to:
Here's how the code could be restructured: