ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
27.55k stars 2.29k forks source link

[Bug]: cannot edit anchor tag in Chrome #5780

Open tasiotas opened 2 weeks ago

tasiotas commented 2 weeks ago

Affected Packages

core

Version(s)

2.9.1

Bug Description

I want to extend Heading so that it has tag inside.

import { Heading as TiptapHeading } from '@tiptap/extension-heading'
import { mergeAttributes } from '@tiptap/vue-3'

export const Heading = TiptapHeading.extend({

  renderHTML({ node, HTMLAttributes }) {
    const hasLevel = this.options.levels.includes(node.attrs.level)
    const level = hasLevel
      ? node.attrs.level
      : this.options.levels[0]

    return [
      `h${level}`,
      mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
      [
        'a',
        {
          href: '/',
        },
        0,
      ],
    ]
  },

})

export default Heading

It works fine in Firefox, but in Chrome I can only input one character. If I edit html via devtools and insert at least two characters into tag, then I can input more, but not when the cursor is at the end of the text. So bizzare! what is going on?

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Be able to edit heading just like in Firefox.

Additional Context (Optional)

No response

Dependency Updates

  • [X] Yes, I've updated all my dependencies.