diff --git a/libs/ngx-blocknote/src/lib/components/formatting-toolbar/default-selects/block-type-select/bna-block-type-select.component.ts b/libs/ngx-blocknote/src/lib/components/formatting-toolbar/default-selects/block-type-select/bna-block-type-select.component.ts index b48de3e..10a9e85 100644 --- a/libs/ngx-blocknote/src/lib/components/formatting-toolbar/default-selects/block-type-select/bna-block-type-select.component.ts +++ b/libs/ngx-blocknote/src/lib/components/formatting-toolbar/default-selects/block-type-select/bna-block-type-select.component.ts @@ -88,7 +88,13 @@ export class BnaBlockTypeSelectComponent { (item) => item.type in editor.schema.blockSchema, ); }); - currentBlockType = signal(undefined); + currentBlockType = signal( + this.filteredBlockTypes().find((a) => + a.isSelected( + this.ngxBlockNoteService.editor().getTextCursorPosition().block, + ), + ), + ); constructor(private ngxBlockNoteService: NgxBlocknoteService) { this.updateCurrentBlockTypeOnChanges();