File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import { TiptapEditor , TiptapExtension } from '../model/TiptapGroup'
22import { Plugin , PluginKey } from 'prosemirror-state'
33import { Decoration , DecorationSet } from '@tiptap/pm/view'
4+ import Article from './Article'
45
56interface SmartActiveOptions {
67 className : string
@@ -35,7 +36,7 @@ export const SmartActive = TiptapExtension.create<SmartActiveOptions>({
3536 } )
3637 )
3738
38- if ( isFirst ) {
39+ if ( isFirst && node . type . name != Article . name ) {
3940 decorations . push (
4041 Decoration . node ( pos , pos + node . nodeSize , {
4142 class : this . options . firstClassName ,
@@ -56,7 +57,7 @@ export const SmartActive = TiptapExtension.create<SmartActiveOptions>({
5657} ) ;
5758
5859export const getFirstActiveNodePosition = ( editor : TiptapEditor ) : { offsetTop : number | null , offsetLeft : number | null } => {
59- const focusClassName = editor . extensionManager . extensions . find ( extension => extension . name === SmartActive . name ) ?. options . className
60+ const focusClassName = editor . extensionManager . extensions . find ( extension => extension . name === SmartActive . name ) ?. options . firstClassName
6061 const editorElement = editor . options . element
6162 const currentNode : Element | null = editorElement ?. querySelector ( `.${ focusClassName } ` )
6263
You can’t perform that action at this time.
0 commit comments