Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Callback not working on Repeater Fields #5732

Closed
christian-heiko opened this issue Jul 17, 2023 · 5 comments
Closed

Default Callback not working on Repeater Fields #5732

christian-heiko opened this issue Jul 17, 2023 · 5 comments
Assignees
Labels
bug Verified bug by the Nova team

Comments

@christian-heiko
Copy link

  • Laravel Version: 9.52.10
  • Nova Version: 4.26.5
  • PHP Version: 8.1.14

Description:

Default Value or Default Value Callback is not working inside of Repeater Fields.

return [ Text::make('Test', 'test')->default(function () { dd('This should be called.'); }), ];

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Create a Repeater Item with Fields
  2. Give the Fields a default value or a default value callback
  3. Check the Form.
@crynobone crynobone self-assigned this Jul 17, 2023
@crynobone crynobone added the bug Verified bug by the Nova team label Jul 17, 2023
@davidhemphill
Copy link
Contributor

@christian-heiko Can I ask what you're using the default method for? We've got a PR in to potentially fix this, but just want to understand your use in the context of the Repeater field. 😃

@christian-heiko
Copy link
Author

In a Tool for an event-company they have events with work-shifts (the repeater). and i want to have the shifts to have the same start/end as the event, as it is the same for 80% of the time.

but thats maybe already a edge-case. most of the time i want to reduce work of the users for stuff that stays the same most of the time but can be changed if needed.

the repeater is a long waited feature as i made a lot of custom components to ease the editor-experience for my clients., which i dont have to anymore. so thanks a lot for the work :)

@davidhemphill
Copy link
Contributor

Glad to hear Repeater is helping. We would add this default feature anyway, but I'm always curious about real-world use cases like yours, so thanks for sharing. Thanks!

@crynobone
Copy link
Member

This has been fixed in 4.27.x releases.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team
Projects
None yet
Development

No branches or pull requests

3 participants