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

Dropdown Float Label: Label is always floated #279

Open
BenJackGill opened this issue Jun 7, 2024 · 2 comments
Open

Dropdown Float Label: Label is always floated #279

BenJackGill opened this issue Jun 7, 2024 · 2 comments

Comments

@BenJackGill
Copy link

Describe the bug

I am using Tailwind PrimeVue with the latest Aura preset.

The Dropdown Float Label feature does not work correctly because the label is always floated, even when no value is selected from the dropdown.

I'm not sure if this is a bug, or the dropdown float label feature is not yet supported on Tailwind PrimeVue. If it is the latter, can I please request the feature is added. It's very helpful for creating forms.

Here is a screenshot showing the problem where no value is selected but the label is still floated. It is using Tailwind PrimeVue and the latest Aura presets:

Screenshot 2024-06-07 at 11 07 52 AM

Here is a screenshot of how it should look. It was taken from the main PrimeVue docs:

Screenshot 2024-06-07 at 11 09 43 AM

Example Code:

<template>
  <div class="m-10">
    <FloatLabel class="w-full">
      <Dropdown
        v-model="selectedCity"
        inputId="dd-city"
        :options="cities"
        optionLabel="name"
        class="w-full"
      />
      <label for="dd-city">Select a City</label>
    </FloatLabel>
  </div>
</template>

<script setup>
import { ref } from 'vue';

const selectedCity = ref();
const cities = ref([
  { name: 'New York', code: 'NY' },
  { name: 'Rome', code: 'RM' },
  { name: 'London', code: 'LDN' },
  { name: 'Istanbul', code: 'IST' },
  { name: 'Paris', code: 'PRS' },
]);
</script>

Reproducer

https://stackblitz.com/edit/nuxt-starter-aq6fq2?file=package.json

PrimeVue version

3.52.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. Go to the reproduction link and see that the label is floated before selecting a dropdown option.

Expected behavior

The label should only be floated after selecting a dropdown option.

@BenJackGill
Copy link
Author

This same problem is happening with the Calendar element.

@Angel892
Copy link

Angel892 commented Jul 8, 2024

I have 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