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

[UDropdown] item.class no longer applied in v2.11.1 #1157

Closed
XStarlink opened this issue Dec 23, 2023 · 4 comments
Closed

[UDropdown] item.class no longer applied in v2.11.1 #1157

XStarlink opened this issue Dec 23, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@XStarlink
Copy link

XStarlink commented Dec 23, 2023

Environment

  • Nuxt 3.8.2
  • Nuxt UI 2.11.1

Version

2.11.1

Reproduction

<template>
  <UDropdown
    :items="actions"
    :ui="{ width: 'w-40' }"
    :popper="{ placement: 'right-start' }"
  >
    <v-icon icon="i-lucide-more-horizontal" size="small" />
  </UDropdown>
</template>

<script setup>
const actions = [
  [
    {
      label: 'Edit',
      icon: 'i-lucide-pen-square',
      click: () => {}
    },
    {
      label: 'Share',
      icon: 'i-lucide-share',
      disabled: true,
      click: () => {}
    }
  ],
  [
    {
      label: 'Delete',
      class: '!text-red-500',
      icon: 'i-lucide-trash-2',
      iconClass: 'text-red-500',
      click: () => {}
    }
  ]
]
</script>

Description

Hello thanks for this great lib,
In my project I used to style some dropdown items with 'class' like this:

{
  label: 'Delete',
  class: 'text-red-500',
  icon: 'i-lucide-trash-2',
  iconClass: 'text-red-500',
  click: () => {}
}

But it doesn't work after updating to 2.11.1, (only iconClass works), is this normal or a bug?

Before:
Capture d’écran 2023-12-23 à 20 17 25

After (In 2.11.1):
Capture d’écran 2023-12-23 à 19 47 56

Additional context

No response

Logs

No response

@XStarlink XStarlink added the bug Something isn't working label Dec 23, 2023
@XStarlink XStarlink changed the title [UDropdown] item.class no longer applied since update 2.11.1 [UDropdown] item.class no longer applied in 2.11.1 Dec 23, 2023
@XStarlink XStarlink changed the title [UDropdown] item.class no longer applied in 2.11.1 [UDropdown] item.class no longer applied in v2.11.1 Dec 23, 2023
Copy link
Member

This is weird, nothing has changed about this. From what version did you upgrade?

@XStarlink
Copy link
Author

This is weird, nothing has changed about this. From what version did you upgrade?

Hello @benjamincanac, I came from v2.10.0, I made two reproductions:

You can see that on v2.11.1 the text with the class is no longer in red, even with !important.

Copy link
Member

The class was no longer applied after this f323379. Thanks for the report!

@XStarlink
Copy link
Author

XStarlink commented Dec 28, 2023

That was fast! Thanks for the fix!

The class was no longer applied after this f323379. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants