Skip to content

Not selecting option if value is integer 0 #52

@vesper8

Description

@vesper8

I have a tinyInteger field that I'm using the InlineSelect field on.

The value can be between 0 and 5

The field looks like this:


InlineSelect::make('Account Level')
                ->options(function () {
                    return [
                        0 => 'Normal User',
                        1 => 'Backer',
                        2 => 'Moderator',
                        3 => 'Tester',
                        4 => 'Admin',
                        5 => 'Super Admin',
                    ];
                })
                ->displayUsingLabels()
                ->inlineOnIndex()
                ->inlineOnLens()
                ->inlineOnDetail()
                ->disableTwoStepOnIndex()
                ->disableTwoStepOnLens()
                ->disableTwoStepOnDetail();

If the value is anything but 0, it correctly selects the currently selected option, but if the value is 0, it fails to select 'Normal User' and instead selects the Choose an option option

Any idea on how to remedy this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions