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

Add a classname to the active block so a custom style can be applied #1046

Open
Musettodotcom opened this issue Sep 2, 2024 · 2 comments
Open
Labels
enhancement New feature or request prio:mid Medium priority

Comments

@Musettodotcom
Copy link

Is your feature request related to a problem? Please describe.
It would be nice to be able change the style of the active block (e.g., set a different background color).

Describe the solution you'd like
Add a class like active-block when the block becomes active and remove it when it becomes inactive.

@Musettodotcom Musettodotcom added the enhancement New feature or request label Sep 2, 2024
@matthewlipski matthewlipski added the prio:mid Medium priority label Sep 2, 2024
@YousefED
Copy link
Collaborator

YousefED commented Sep 5, 2024

For now, you could use const selectedBlocks = useSelectedBlocks(editor); and check if selectedBlocks matches the block (props.block). Does this help?

Curious to hear what you're building!

@Musettodotcom
Copy link
Author

Working on a way for drum and piano teachers to create more complex lessons with video, text, lists, images, and some custom controls we are building for playing back musical patterns and songs, as well as interactive MIDI feedback.

The plan is for BlockNote to serve as the basis for the editor and then write custom components for the interactive music parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prio:mid Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants