# Dropcursor not displayed at correct position

**URL:** https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519
**Category:** Uncategorized
**Created:** [February 10, 2020, 10:06am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519 "2020-02-10T10:06:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Leaze](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/l/13edae/32.png) [@Leaze](https://discuss.prosemirror.net/u/Leaze)
#### Post date: [February 10, 2020, 10:06am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519/1 "2020-02-10T10:06:47Z")

</div>

For me, the [prosemirror-dropcursor](https://github.com/ProseMirror/prosemirror-dropcursor) is not displayed at the correct position sometimes. The cursor-decoration is offset vertically and does not always occur (I’m not sure when exactly but it seemed like the further down the document, the more likely it was to happen) Are there known bugs with it? May I just be using it incorrectly?

**How it looks:**

 ![prosemirror_dropcursor_bug](https://discuss.prosemirror.net/uploads/secondsite/original/2X/6/60f694ebe7f7894962cdad390fc24c14875f2937.gif)

**How it is added to the code:**

```
const state = EditorState.create({
  ...
  plugins: [
    ...
    dropCursor(),
    ...
  ]
});

```

**Setup** I am using Ubuntu 18.04 and tried both Firefox 72.0.2 and Chromium 79.0.3945.130 with both having the behavior described.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [February 11, 2020, 8:13am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519/2 "2020-02-11T08:13:24Z")

</div>

Does the vertical offset correspond to the scroll position, in any chance? Could you reduce the HTML and CSS context needed to reproduce the issue to the minimum to see if anything specific triggers the problem?

---

<div class="post-metadata">

### Author: ![Leaze](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/l/13edae/32.png) [@Leaze](https://discuss.prosemirror.net/u/Leaze)
#### Post date: [February 11, 2020, 9:03am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519/3 "2020-02-11T09:03:17Z")

</div>

Yes, it seems that you’re right in that it corresponds to the scroll position. The offset actually seems to be exactly the same as how far I scrolled down on the page. I could try reducing HTML and CSS down, but it might take me some time to do so.

---

<div class="post-metadata">

### Author: ![Leaze](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/l/13edae/32.png) [@Leaze](https://discuss.prosemirror.net/u/Leaze)
#### Post date: [August 25, 2020, 6:13am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519/4 "2020-08-25T06:13:08Z")

</div>

I got the problem fixed by setting `position: relative` on a `div` wrapping the editor. Do you have to always provide such a wrapper for dropcursor to display correctly?

PS: Sorry for taking so long to reply, but at first I didnt manage to reduce the HTML/CSS and reproduce the issue and then I didn’t work on that project for some time.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)
#### Post date: [August 25, 2020, 9:02am UTC](https://discuss.prosemirror.net/t/dropcursor-not-displayed-at-correct-position/2519/5 "2020-08-25T09:02:38Z")

</div>

> [@Leaze](#):
>
> Do you have to always provide such a wrapper for dropcursor to display correctly?

No. There’s probably also something else in your layout that triggers this.
