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

bug: The <a> tag in .menu has an abnormal style when it is focused and active #1868

Closed
zkl2333 opened this issue Jun 1, 2023 · 3 comments
Closed

Comments

@zkl2333
Copy link

zkl2333 commented Jun 1, 2023

What version of daisyUI are you using?

v3.0.0

Describe your issue

The <a> tag in .menu has an abnormal style when it is focused and active
image
image

What browsers are you seeing the problem on?

Chrome

Reproduction URL (optional)

No response

@zkl2333 zkl2333 changed the title bug: bug: The <a> tag in .menu has an abnormal style when it is focused and active Jun 1, 2023
@Bjeaurn
Copy link

Bjeaurn commented Jun 1, 2023

Seeing the same, it seems to default to use the --n variable for neutral color as background, instead of using primary or --p like it did previously. Might be a regression.

Managed to fix it temporarily for my situation using the following:

a {
      &:active {
        @apply bg-primary;
      }

      &.active {
        @apply bg-primary;
      }
    }

@Andrew67
Copy link

Andrew67 commented Jun 2, 2023

Another workaround: I was already applying bg-primary to active menu items, so I changed it to bg-primary focus:bg-primary-focus and it also worked.

@Mohamad-Simmo
Copy link

You could also remove focus from the element after it's clicked

const handleClick = () => {
  if (document.activeElement instanceof HTMLElement) {
    document.activeElement.blur();
  }
};

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

4 participants