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

Fix native open in a new tab in components with a custom router link #3954

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

ShGKme
Copy link
Contributor

@ShGKme ShGKme commented Apr 4, 2023

Expected behavior

Ctrl+Click, Shift+Click and etc. on a link in NcListItem and NcAppNavigationitem opens the link in a new tab.

Actual behavior

Nothing happened

Problem description

In NcListItem and NcAppNavigationitem when the item is a RouterLink, navigation after a click is handled manually, while default behavior stops with event.preventDefault().

It breaks a native web-browser behavior - the ability to open a link in a new tab by combining a Click with a modifier key, for example, Ctrl+Click.

This PR checks if modifiers are pressed before the manual navigation and preventing default behavior.

Regression of: #3775

Continue of: #3922

Related: nextcloud/talk-desktop#104

@ShGKme ShGKme added the 2. developing Work in progress label Apr 4, 2023
@ShGKme ShGKme self-assigned this Apr 4, 2023
@ShGKme ShGKme force-pushed the fix/noid/open-in-a-new-tab-in-custom-router-link branch from d3bd67c to 5c7756c Compare April 4, 2023 16:43
@ShGKme ShGKme added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 6, 2023
@ShGKme ShGKme marked this pull request as ready for review April 6, 2023 14:51
@skjnldsv skjnldsv merged commit 2e57f70 into master Apr 6, 2023
@skjnldsv skjnldsv deleted the fix/noid/open-in-a-new-tab-in-custom-router-link branch April 6, 2023 20:30
@ShGKme ShGKme added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Apr 13, 2023
@ShGKme ShGKme added this to the 7.9.1 milestone Apr 13, 2023
@Pytal Pytal mentioned this pull request Apr 17, 2023
@AndyScherzinger AndyScherzinger modified the milestones: 7.9.1, 7.10.0 Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants