reflex icon indicating copy to clipboard operation
reflex copied to clipboard

pc.upload does not support event handler list

Open evandeng2009 opened this issue 2 years ago β€’ 1 comments

Describe the bug pc.uolpad, followed by pc.icon: pc.icon(tag="arrow_up", on_click=[lambda: State.assign_tid(item[1][1]), lambda: State.handle_upload(pc.upload_files())] And handle_upload will read a base var setted by assign_tid to rename the file.

Problem is: I see assign_tid has been executed, while handle_upload not. If this is not supported, anyway to rename the uploaded file with a dymanic and specified one?

To Reproduce Steps to reproduce the behavior:

  • Code/Link to Repo:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

** Specifics (please complete the following information):**

  • Python Version:3.7
  • Reflex Version:0.1.34
  • OS: Windows
  • Browser (Optional):

Additional context Add any other context about the problem here.

evandeng2009 avatar Jul 03 '23 14:07 evandeng2009

Yes, the pc.upload_files() cannot work in the event chain.

milochen0418 avatar Jul 03 '23 16:07 milochen0418

I need to rename the file according to the place where upload button is clicked. Anyone knows how to do this as a workaround before event chain finally is supported please?

evandeng2009 avatar Jul 31 '23 14:07 evandeng2009

Dupe of #1066

masenf avatar Nov 27 '23 22:11 masenf