Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
tasiotas opened this issue Oct 28, 2024 · 0 comments
Open
1 task done

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

tasiotas opened this issue Oct 28, 2024 · 0 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@tasiotas
Copy link

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

  • Yes, I've updated all my dependencies.
@tasiotas tasiotas added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant