web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Going through the link with the popup opens the cursor

Open d-e-v-esh opened this issue 4 years ago • 4 comments

Bug Report 🐛

When we move our cursor forward in a line with the right arrow where one of the words is a hyperlink, the link popup opens up and the cursor jumps to the link URL input field.

Expected Behavior

The pop-up should not open up until we click on the hyperlink text. The cursor should move past the letters in the text one by one without the pop-up opening.

Current Behavior

It jumps to the URL input field as soon as the cursor touches the hyperlink text. CzyPqxr24S

Steps to Reproduce

  1. Open up Storybook => Markdown Editor
  2. Go to the first line which has a hyperlink text with the right arrow.
  3. As soon as the cursor touches the hyperlink text, the link pop-up would open up.

Context (Environment)

Desktop

  • OS: Windows 10
  • Browser: Chrome
  • Version 88.0.4324.182 (Official Build) (64-bit)

Detailed Description

Possible Implementation

d-e-v-esh avatar Mar 11 '21 20:03 d-e-v-esh

@irmerk @DianaLease @Michael-Grover I have added a PR for the issue. This might be able to resolve the issue. Requesting a review from the maintainers.

K-Kumar-01 avatar Mar 12 '21 06:03 K-Kumar-01

I wonder if this is a bug or a feature. As we can see in the source code there is an explicit if condition to show the model when the cursor is inside the link.

https://github.com/accordproject/web-components/blob/90973d4087a1505098ec43a8a9e2df92977987f8/packages/ui-markdown-editor/src/index.js#L146-L148

If we let the cursor move forward in the link body, I believe they can also change the text and it will lead to a change in the name of the link. As I can see, the maintainers wanted to only have a single source of changing the link i.e LinkModal.

iamsaumya avatar Mar 12 '21 09:03 iamsaumya

web-components/packages/ui-markdown-editor/src/index.js

@jeromesimeon I see that you made the change that introduced https://github.com/accordproject/web-components/blob/90973d4087a1505098ec43a8a9e2df92977987f8/packages/ui-markdown-editor/src/index.js#L146-L148

Do you recall why you wanted this behaviour, please?

mttrbrts avatar Mar 12 '21 10:03 mttrbrts

This seems related to #114. I think this needs more investigation before moving on to a PR (#297)

jolanglinais avatar Mar 12 '21 16:03 jolanglinais