Skip to content

a-select placeholder not displayed when v-model:value initialized with empty string #8396

@parade0393

Description

@parade0393
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.6

Environment

vue:3.5.22,brower:chrome140.0.7339.208

Reproduction link

https://stackblitz.com/edit/vitejs-vite-h373sqsp?file=src%2FApp.vue

Steps to reproduce

When a-select component's v-model:value is initialized with an empty string '',
the placeholder is not displayed. However, when initialized with undefined or null,
the placeholder displays correctly.

What is expected?

The placeholder should be displayed regardless of whether the initial value is an empty
string, undefined, or null, as they all represent an unselected state from a UX perspective.

What is actually happening?

  • When const value = ref('') - placeholder is not displayed, component width collapses
  • When const value = ref() or ref(undefined) - placeholder is displayed correctly

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