Skip to content

Commit

Permalink
fix: set initial value on block type select component
Browse files Browse the repository at this point in the history
  • Loading branch information
m-risto committed Sep 17, 2024
1 parent cf89262 commit 63bc7f1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export class BnaBlockTypeSelectComponent {
(item) => item.type in editor.schema.blockSchema,
);
});
currentBlockType = signal<BlockTypeSelectItem | undefined>(undefined);
currentBlockType = signal<BlockTypeSelectItem | undefined>(
this.filteredBlockTypes().find((a) =>
a.isSelected(
this.ngxBlockNoteService.editor().getTextCursorPosition().block,
),
),
);

constructor(private ngxBlockNoteService: NgxBlocknoteService) {
this.updateCurrentBlockTypeOnChanges();
Expand Down

0 comments on commit 63bc7f1

Please sign in to comment.