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

Use taggable dynamic content in other field dependsOn dynamically #258

Open
couchlab-pl opened this issue Jul 14, 2024 · 2 comments
Open

Comments

@couchlab-pl
Copy link

couchlab-pl commented Jul 14, 2024

Hi,

Hope someone know the solution or some update needed. Thanks in advance.

I have two fields, one to define list of possible choices, second to choose right answer.
Sadly when adding dynamic taggable values to the first field, second does not receive changed event.

Multiselect::make(('tr.task_choice_options'), 'choice_choices')->hide()->taggable()->saveAsJSON()
->dependsOn(
['task_type'],
function ($field, $request, $formData) {
if ($formData->task_type === TaskTypeEnum::Choice) {
$field->show()->required();
}
}
),
Multiselect::make(
('tr.task_choice_options'), 'choice_choice')->hide()->singleSelect()
->dependsOn(
['task_type','choice_choices'],
function ($field, $request, $formData) {
if ($formData->task_type === TaskTypeEnum::Choice) {
$field->options(json_decode($formData->choice_choices))->show()->required();
}
}
)

@couchlab-pl
Copy link
Author

Please can you watch for this. I think that is easy to fix because when you removing option with taggable the change event is firing, not working only when adding new tags.

@nastoychev
Copy link

I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants