orchidsoftware / platform

Orchid is a @laravel package that allows for rapid application development of back-office applications, admin/user panels, and dashboards.
https://orchid.software
MIT License
4.26k stars 631 forks source link

Listener not compatible with Select ->multiple() option #2717

Open milovanderpas opened 9 months ago

milovanderpas commented 9 months ago

Describe the bug When I make a listener and set a Select field as target that has the multiple() option on. Than the listener won't be triggered, when I remove the multiple() on the Select field the listener does trigger on change.

To Reproduce Steps to reproduce the behavior:

  1. Create Listener
  2. Add Select field with the multiple() option enabled
  3. Set Select field as target
  4. Check if Listener trigger is called, when Select field is updated

Expected behavior I expected that the listener would be triggered, when a selected one or more values from the Select field.

Screenshots image

Desktop (please complete the following information):

Server (please complete the following information):

vitortoigo commented 2 months ago

I have the same problem, has it been resolved somehow?

tabuna commented 2 months ago

When referring to multiple values, it is necessary to add a "dot" at the end of the name. For example, options.. This is because in HTML, the multiple tag is written as <select name="options[]">.

vitortoigo commented 2 months ago

When referring to multiple values, it is necessary to add a "dot" at the end of the name. For example, options.. This is because in HTML, the multiple tag is written as <select name="options[]">.

Thanks for this, tabuna, working 100%.

For some reason, the listener dont enter in handle method, asyncMethod works normally, but I need to set the values with $repository->set so they don't reset every time a change is made.