Summary
This appears to be a recent change in expected behavior. Previously ctrl-clicking on a preview opened the page in a new tab. Now the same happens but it also registers as having clicked the preview. The result is two tabs with the same article open. The desired outcome is a new tab open with the ctrl-clicked article and the reader is left in the original window to continue reading the current article.
Steps to reproduce
- Visit a wiki with Page Previews enabled.
- Hover over a link to activate a page preview
- Ctrl or command +click somewhere in the preview
Outcome: Both the current window and a new tab are directed to the target page
Expected behavior: Ctrl+clicking will open the page in the preview in a new tab. The current window will not be affected.
Tested in latest version of Safari and Chrome on the latest version of MacOS.
First reported: https://www.mediawiki.org/wiki/Topic:Ui0q8z2djjkdqapu
Developer notes
git bisect shows this was caused by https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Popups/+/442880/ (T192773)
Some possible ways to fix this behaviour as well as the issue described in T192773
- revert the patch for T192773 and rethink the approach for that by wrapping the entire popup including image in a link.
- Use window.open (seems risky as modifier keys may differ by browser)
- Decline this card or other card
- Refactor linkClick to take the ev and stopPropagation to the link element/don't open link, if any modifier key held (untested but might work but might have cause other unexpected behaviour)