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

Select with template, renders white list with opaque options. No error output.Strange behaviour. #7260

Open
1 of 4 tasks
ciumexan opened this issue Feb 15, 2025 · 3 comments
Labels
Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated.

Comments

@ciumexan
Copy link

Describe the bug

Hello. We have this issue, where all the populated template becomes white with no actual error popping out.

Image

our code looks like this:

<template>

<Select id="brandul" v-model="selectedBrand" :options="theBrands" :placeholder="$t('garage_add_bike_select_brand')" fluid class="p-2">
                          <template #option="{ option }">
                                    <div class="flex items-center gap-2">
                                      <div><img class="w-10 h-10 rounded-full" :src="`/img/brands/${option.img}.jpg`"/></div>
                                      <div class="uppercase font-black">{{ option.marca }}</div>
                                    </div>
                          </template> 
                          <template #value="slotProps">
                                      <div v-if="slotProps.value" class="flex items-center">
                                        <div class="flex items-center gap-2 text-xs">
                                          <div><img class="w-6 h-6 rounded-full" :src="`/img/brands/${slotProps.value.img}.jpg`"/></div>
                                          <div class="uppercase font-black">{{ slotProps.value.marca }}</div>
                                        </div>
                                      </div>
                                      <span v-else>
                                          {{ slotProps.placeholder }}
                                      </span>
                                  </template>
                          
                        </Select>
</template>



<script lang="ts" setup>
const theBrands = ref([{"id":"00","marca":"- NoName","img":"noname"},
{"id":"119","marca":"Zuendapp","img":"zuendapp"}, {"id":"119","marca":"Zuendapp","img":"zuendapp"}] //here all the 150 brands.
const selectedBrand = ref()
</script>

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-g639dwdm?file=src%2FApp.vue

Environment

NUXT3, inside a vue component using composition api and typescript

Vue version

3.5.13

PrimeVue version

4.2.5

Node version

v20.11.1

Browser(s)

Chrome / Safari

Steps to reproduce the behavior

see the video. It is because of the id of the select (maybe because we want to use linked selects?)

Expected behavior

Expected to see complete selection of options. Like this is a white transparent list. If you click anywhere in the transparent area actually you can select... as you can see in the animation attached.

@ciumexan ciumexan added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 15, 2025
@ridernet
Copy link

ridernet commented Feb 18, 2025

I get the same behaviour and ended up using the normal select (not primevue's)
I just realised that this behaviour happens where there are more than one Select in the component.
Maybe using a different id for each select will solve it?

@ciumexan
Copy link
Author

ciumexan commented Feb 20, 2025

I keep getting this behaviour in primevue select dialogs.
I guess is the tailwind and primevue not playing correctly
My versions:
tailwindcss@3.4.17
primevue@4.2.5
nuxt@3.15.4

My implementation on CSS is:

@layer tailwind-base, primevue, tailwind-utilities;

@layer tailwind-base {
    @tailwind base;
}

@layer tailwind-utilities {
    @tailwind components;
    @tailwind utilities;
}

and my config is:

  css: [
            'primeicons/primeicons.css',
          ],
          primevue: {
                    options: {
                              theme: {
                                      preset: mythemelook,
                                      options: {
                                                    prefix: 'p',
                                                    darkModeSelector: '.mytheme-dark',
                                                    cssLayer: false
                                               },
                                               
                                     }
                             }
                    },

Do you have any idea where to search for the pb.? I donțt get any verbose logs or any error... the dialog is opaque... the data is still there...

@tugcekucukoglu
Copy link
Member

We couldn't run the stackblitz demo because there were too many errors. Please update the demo.

@tugcekucukoglu tugcekucukoglu added Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs Revision The pull request can't be merged. Conflicts need to be corrected or documentation and code updated.
Projects
None yet
Development

No branches or pull requests

3 participants