Repeater - strange behaviour

I am using repeater.
I have a toggle field, when on, it adds the items to the repeater.

If I try to reorder them with drag&drop, items are added again.
If I reorder with the buttons, everything is fine.

Is this a bug?


 if($state) {
      if(count($get('working_hours')) === 0) {
          foreach (DayOfWeek::cases() as $index => $dayOfWeek) {
              $set("working_hours.$index.day", CompanyHelper::company()->working_hours[$index]['day'] ?? null);
              $set("working_hours.$index.start", CompanyHelper::company()->working_hours[$index]['start'] ?? null);
              $set("working_hours.$index.end", CompanyHelper::company()->working_hours[$index]['end'] ?? null);
          }
      }
      return;
  }

working_hours è il repeater
image.png
image.png
Was this page helpful?