Skip to content

Select components may throw non-primitive key error #233

Closed
@fairking

Description

@fairking

Primevue v1.0.7

I got confused with the error message when my SelectButton clearly describes the key and that key is a string and it is definitely unique.

The implementation bellow:

<SelectButton id="actions" v-model="item.workflowState" data-key="id" :options="item.workflowStates" option-disabled="disabled">
    <template #option="slotProps">
        <div :title="slotProps.option.name">
            <span :class="slotProps.option.icon" style="margin:10px;"></span>
        </div>
    </template>
</SelectButton>

The error message is: [Vue warn]: Avoid using non-primitive value as key, use string/number value instead. Found in <SelectButton> at node_modules/primevue/components/selectbutton/SelectButton.vue

However if I add the label option-label="name" to the SelectButton the error dissapears.

I guess it is a bug, as the option-label is used as a key instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions