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

MultiSelect->displayUsingLabels() only works with a single item selected #6405

Closed
bergstar opened this issue May 25, 2024 · 1 comment
Closed
Assignees
Labels
bug Verified bug by the Nova team
Milestone

Comments

@bergstar
Copy link

  • Laravel Version: 11.8.0
  • Nova Version: 4.34.2
  • PHP Version: 8.3

Description:

When using MultiSelect in combination with displayUsingLabels() labels are only rendered correctly if single item has been selected.

            MultiSelect::make('Hair Products')->options([
                'volumizing' => 'Volumizing',
                'moisturizing' => 'Moisturizing',
                'anti_frizz' => 'Anti-frizz',
                'color_preservation' => 'Color preservation',
                'damage_treatment' => 'Damage treatment',
            ])->displayUsingLabels(),

Single item stored:
Screenshot 2024-05-25 at 20 02 38

Multiple items stored:
Screenshot 2024-05-25 at 20 02 48

Preference.php

class Preference extends Model
{
    use HasFactory;

    protected $casts = [
        'hair_products' => 'array',
    ];
@crynobone crynobone added the bug Verified bug by the Nova team label May 28, 2024
@crynobone crynobone self-assigned this May 28, 2024
@crynobone crynobone added this to the 4.x milestone Jun 1, 2024
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 Jun 18, 2024
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

2 participants