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

Custom block with content-type="none" formatting toolbar appears as small dot #1093

Closed
1 task
jehaad1 opened this issue Sep 21, 2024 · 2 comments
Closed
1 task
Labels
bug Something isn't working

Comments

@jehaad1
Copy link

jehaad1 commented Sep 21, 2024

Describe the bug
When selecting a custom block content-type="none" with no default props (align, text color, bg color), the formatting toolbar appears as a small dot, when it should be hidden

To Reproduce
I have this custom hr block with no default values, check this when I select it
image
Take a closer look at this zoom image
image

Misc

  • Node version: Latest
  • Package manager: NPM
  • Browser: Arc
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖
@jehaad1 jehaad1 added the bug Something isn't working label Sep 21, 2024
@matthewlipski
Copy link
Collaborator

Kind of odd since there should already be this CSS in the BlockNote styles that handles this:

.bn-mantine .bn-toolbar:empty {
  display: none;
}

Either way, try adding it manually to see if it fixes it

@jehaad1
Copy link
Author

jehaad1 commented Oct 5, 2024

I came with another solution that's more supported by browsers:

.bn-mantine .bn-toolbar:empty,
.bn-mantine .bn-toolbar:not(:has(*)) {
  @apply !hidden !opacity-0 !bg-transparent;
}

Since your code is already in the core of the library css, it doesn't work for me because my browser (Arc) doesn't support ":empty" pseudo-class yet, but support ":not(:has(*))".

you can add it to the library css

@jehaad1 jehaad1 closed this as completed Oct 8, 2024
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