Skip to content

fix(editor): fix horizontal rule not allowing input on empty editor (#635) (#642)#8

Merged
paulirwin merged 1 commit into
masterfrom
fix/horizontal-rule-empty-editor
May 12, 2026
Merged

fix(editor): fix horizontal rule not allowing input on empty editor (#635) (#642)#8
paulirwin merged 1 commit into
masterfrom
fix/horizontal-rule-empty-editor

Conversation

@paulirwin

Copy link
Copy Markdown
Member

Pulls upstream PR sibiraj-s/ngx-editor#642 into the fork ahead of upstream merging it.

Fixes upstream issue #635 — inserting a horizontal rule on an empty editor (and a few adjacent cursor-position cases) no longer leaves the editor in a state where the user can't type. The fix rewrites HorizontalRule.insert() to split the parent block around the cursor, pad with an empty paragraph when needed so the cursor has a landing spot, and properly position the selection after the HR.

Summary

  • projects/ngx-editor/src/lib/commands/HorizontalRule.ts — rewritten insert() command
  • projects/ngx-editor/src/lib/editor.spec.ts — new specs covering the regression and adjacent HR scenarios

Test plan

  • npm run test:lib passes locally against Angular v21 (38/38, +5 new)
  • CI passes
  • Manual smoke: open the demo with an empty editor, click HR in toolbar, confirm typing works after

@paulirwin paulirwin merged commit c99a7ba into master May 12, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant