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

Middle click on links must not insert text #2198

Closed
PVince81 opened this issue Feb 23, 2022 · 8 comments · Fixed by #5158
Closed

Middle click on links must not insert text #2198

PVince81 opened this issue Feb 23, 2022 · 8 comments · Fixed by #5158
Labels
1. to develop bug Something isn't working high

Comments

@PVince81
Copy link
Member

Describe the bug
Middle clicking on links still inserts text

To Reproduce
Steps to reproduce the behavior:

  1. Create a text document with a link
  2. Middle click on the link to open to a new tab
  3. Come back to the editor's tab

Expected behavior
New tab is opened, no text inserted.

Screenshots

Client details:

  • OS: openSUSE Tumbleweed
  • Browser: Firefox
  • Version: 97.0
  • Device: desktop

Server details:
c.nc.com

@PVince81 PVince81 added the bug Something isn't working label Feb 23, 2022
@luka-nextcloud
Copy link
Contributor

Middle click does nothing - neither insert a text nor open a new tab.
It should open a new tab.

@mejo-
Copy link
Member

mejo- commented Nov 15, 2022

@luka-nextcloud not sure what operating system you're using. The problem with middle-click inserting text is probably on Linux only. There, middle click inserts content from a buffer that contains the last selection. I can reproduce the issue and regularly run into it myself 🙈

@mejo- mejo- added the high label Nov 15, 2022
@ChristophWurst
Copy link
Member

I'm happy to find out it doesn't only happen to me. I'm just used to opening links in new tabs and here in Text that leads to very unexpected text alteration.

@mejo-
Copy link
Member

mejo- commented Dec 31, 2022

In latest Text (both NC 25.0.2 and NC 26 development branch), middle clicking on links no longer opens the links on Linux. Instead, it only inserts text from the selection clipboard. I don't know which code change introduced that change of behaviour, though. Maybe some upstream changes in Tiptap?

I wonder whether opening links in new tabs also doesn't work anymore on non-Linux operating systems. Maybe people with Windows and MacOS X can comment.

To be honest, I would be fine with this behaviour. Middle-clicking for opening in new Tab is probably a niche featue anyway and those who use it will learn quickly that it doesn't work in Text. It's kindof useless in text anyway as we open external links in new tabs/windows per default.

For me, this solves the issue at hand (other than expected, admittedly 😉). Waiting for others to confirm before closing the issue though.

@juliushaertl
Copy link
Member

On macOS middle click also does nothing when clicking a link.

Could be related to introducing the click preventer in 3669903

Without that custom behavior I could imagine an upstream issue like ueberdosis/tiptap#3302

@mejo-
Copy link
Member

mejo- commented Jan 1, 2023

Could be related to introducing the click preventer in 3669903

Reverting this commit doesn't change the behaviour for me.

In any case, given that the changed behaviour fixed the issue at hand, shall we close this issue?

@mejo- mejo- closed this as completed Mar 1, 2023
@blizzz
Copy link
Member

blizzz commented Jun 19, 2023

I still happens to me all the time. When I intend to open links in new tabs, I always automatically hit middle-click.

In any case, given that the changed behaviour fixed the issue at hand, shall we close this issue?

What do you refer to?

@blizzz blizzz reopened this Jun 19, 2023
@mejo-
Copy link
Member

mejo- commented Jun 19, 2023

What do you refer to?

Interesting. Last time I tested, I was no longer able to reproduce the bug - that's what I meant with "changed behaviour". But I can reproduce the bug now, so agree that we further look into this.

I also added it back to the respective buckets in our planning board.

mejo- added a commit that referenced this issue Jan 18, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.
mejo- added a commit that referenced this issue Jan 18, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.
mejo- added a commit that referenced this issue Jan 18, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.
mejo- added a commit that referenced this issue Jan 18, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 22, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 24, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 24, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 24, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 25, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 26, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 26, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 27, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 27, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 29, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 29, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
mejo- added a commit that referenced this issue Jan 30, 2024
New link click behaviour:
* Link left clicks without Ctrl/Meta open link bubble (Fixes: #3691)
* Link left clicks with Ctrl/Meta open link in new tab
* Link middle clicks open link in new tab
* Link middle clicks on Linux don't paste content (Fixes: #2198)
* No more custom open link handler in editor

Implementation details:
* Moved link click handler plugins back into Link mark class.
* Added 'data-md-href' attribute to a-elements in DOM, to be used in
  onClick handlers.

Signed-off-by: Jonas <[email protected]>
@mejo- mejo- closed this as completed in bbee8a0 Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop bug Something isn't working high
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants