Prosemirror: Placing an inline node at the end of a line prevents putting the cursor at the end of the line by clicking

Created on 26 Jul 2016  路  7Comments  路  Source: ProseMirror/prosemirror

With the following example content, clicking at the end of the line selects the image and triggers a clickOn. This prevents me from for example creating a new empty paragraph below the existing one by using the mouse and pressing Enter.
inline_node_click

I would suggest not triggering a clickOn event and simply putting the cursor behind the inline node. This seems to be a regression as I did not have this problem with earlier versions of ProseMirror (e.g. 0.7.0).

All 7 comments

I'm not seeing this problem on the master branch. If I have an image node as the last node in a textblock, clicking after it consistently puts the cursor after it.

I'm sorry I tested this with 0.8.3 and you are right that this works fine on the master branch :) Great!

Fixed in master again.

I can confirm this is now working for image nodes :)
But I just found another case where the clickOn gets triggered when clicking at the end of the line. I have a Paragraph containing a single inline node, which is rendered with the following DOM structure:

node_dom

(In this case I want to handle the clickOn event when the node is clicked to overwrite the default href click behavior.)

I just noticed that this issue is closed, but I am still experiencing the problem I described in my last comment with inline nodes that are not images. Would be really great to have a fix or a workaround for this as I have multiple nodes using the described DOM structure. I assume that the incorrect selection and clickOn behavior is caused by the same issue.

Yeah, I still had the email starred to look into it, but I'll reopen the issue as well.

Patches 0d2968494 and 806d13fff031a make this go away even for nodes with children.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bradleyayers picture bradleyayers  路  4Comments

thomasWajs picture thomasWajs  路  6Comments

marijnh picture marijnh  路  5Comments

SamyPesse picture SamyPesse  路  3Comments

WesleyKapow picture WesleyKapow  路  5Comments