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]: Hidden cursor on custom component who gets wrapped to new line #6159

Closed
1 task done
mathix420 opened this issue Mar 4, 2025 · 2 comments
Closed
1 task done
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

@mathix420
Copy link

Affected Packages

@tiptap/vue-3, @tiptap/core

Version(s)

2.11.5

Bug Description

See how the cursor is hidden on this case

screen-capture.28.webm

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

Cursor should be visible the same way it is for the other fields.

Additional Context (Optional)

Custom component:

    <NodeViewWrapper
      as="span"
      class="relative inline-flex items-center justify-start gap-1 rounded-md bg-primary-600/5 px-1.5 py-0.5 align-baseline text-primary-600"
    >
      <span
        v-if="isEmpty"
        contenteditable="false"
        class="pointer-events-none line-clamp-1 leading-5 text-primary-300"
      >
        {{ placeholder }}
      </span>
      <NodeViewContent
        as="span"
        :class="[node.attrs.size === 'multiline' ? 'flex': 'inline-flex', isEmpty ? 'absolute inset-x-1.5 inset-y-0.5': '']"
        class="inline leading-5 outline-none prose-strong:!text-primary-600"
      />
    </NodeViewWrapper>

Dependency Updates

  • Yes, I've updated all my dependencies.
@mathix420 mathix420 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 Mar 4, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Tiptap: Issues Mar 4, 2025
@litingyes
Copy link

I think that under no circumstances should you customize DOM elements as span in editable DOM, because it have special processing in prosemirror and may cause unpredictable problems.

@mathix420
Copy link
Author

Found the issue, it was just css/chrome issue making the NodeViewContent a display: inline; did the trick.

@litingyes you might be right, I'll keep this in mind in case I have any other weird issue, for now everything works like a charm.

@github-project-automation github-project-automation bot moved this from Needs Triage to Closed in Tiptap: Issues Mar 5, 2025
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
Status: Closed
Development

No branches or pull requests

2 participants