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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Going through the link with the popup opens the cursor #295

Open
d-e-v-esh opened this issue Mar 11, 2021 · 4 comments
Open

Going through the link with the popup opens the cursor #295

d-e-v-esh opened this issue Mar 11, 2021 · 4 comments

Comments

@d-e-v-esh
Copy link
Contributor

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

@K-Kumar-01
Copy link
Contributor

@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.

@iamsaumya
Copy link

iamsaumya commented Mar 12, 2021

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.

if (selection && isSelectionLinkBody(editor)) {
setShowLinkModal(true);
}

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.

@mttrbrts
Copy link
Sponsor Member

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

@jeromesimeon I see that you made the change that introduced

if (selection && isSelectionLinkBody(editor)) {
setShowLinkModal(true);
}

Do you recall why you wanted this behaviour, please?

@irmerk
Copy link
Member

irmerk commented Mar 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants