How to implement keyboard shortcuts for changing heading levels

Open
#129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
frontend

Research direction

Start by reviewing Editor.js's tool shortcut configuration and the Header Tool's existing heading-level behavior. Confirm whether shortcuts can target an already inserted header block; done means an agreed, supported approach for CMD+ALT+1, CMD+ALT+2, and the other heading levels.

Written by the indexing model from the issue text.

Description

I would like to allow users to change the heading level directly via keyboard shortcuts (e.g. CMD+ALT+1 for H1, CMD+ALT+2 for H2, etc.).

EditorJS has a shortcut option in the tools configuration, but it only allows defining a shortcut to insert a header block, not to change its level once it is already inserted.

Is there an official or recommended way to bind keyboard shortcuts to heading level changes in EditorJS?

If this is not currently supported, would it be something that could be added to the plugin?

Dominant language
TypeScript
Stars
115
Forks
123
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from editor-js/header

All issues in editor-js/header

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.