-2

The keyboard shortcut E sometimes edits a post that isn't the post currently visible to the user. Example (I pressed E to edit) with this URL:

screen recording showing the bug

Tested with the latest version of Chrome on Windows 10.

7
  • 1
    Doesn’t it have to do with keyboard focus and not what just happens to be visible in your browser window? Commented Jun 17 at 22:02
  • @testing-ma-lady I don't think so. I hadn't selected anything. But I couldn't find any robust logic yet: e.g., on the same page, the keyboard shortcut E sometimes doesn't even edit anything. Commented Jun 17 at 22:47
  • 3
    Are you sure nothing was selected? In high contrast dark mode, it's impossible to see the selection highlight. You seem to be using some custom theme (not high or regular contrast dark), however, when you hit E, that should still select the post and in the clip there is no hint of the highlight there. The post might have been selected from before.
    – VLAZ
    Commented Jun 18 at 4:46
  • We don't attempt to determine a post based on what is visible on the screen. It will trigger the edit for whichever post currently has the keyboard-selected class on it due to being focused.
    – animuson StaffMod
    Commented Jun 19 at 6:46
  • @animuson unless nothing was selected. Then it tries to select+edit the top visible post on the screen. But I've found it's a bit inconsistent when a post is not fully shown, e.g., half of it is visible. It mostly seems to be a problem if the next post is also not fully show (because it's too long). Then it might select one or the other.
    – VLAZ
    Commented Jun 19 at 6:52
  • 5
    @animuson also, FWIW, in high contrast dark mode the highlight is applied but also literally invisible. OP here doesn't seem to be using the high contrast dark mode from SO (probably a plugin or a browser option). But it'd have the same problem. The highlight is a box-shadow: 15px 15px 50px rgba(0, 0, 0, .2) inset; which is applied over a black (rgb(0, 0, 0)) background. Since there is zero visual feedback that something is selected, it's understandable that users might be confused how the edit (and other actions) choose their target.
    – VLAZ
    Commented Jun 19 at 7:04
  • @VLAZ you're right, a post was selected, which I didn't see as I use Chrome's built-in dark mode. Can you please add an answer? thanks. Commented Jun 21 at 17:49

1 Answer 1

2

When using keyboard shortcuts, actions related to posts will target a "selected" post. Selection happens either through shortcuts for that or with some actions. However, once selected all future actions will still target the same selected question regardless where in the page you are.

Normally, the selection shows up as a grey-ish background, more intensive towards the outer border. Here is an example:

.keyboard-selected {
  box-shadow: 15px 15px 50px rgba(0, 0, 0, .2) inset;
}

div {
  padding: 10px;
}
<div>Bacon ipsum dolor amet leberkas porchetta beef ribs landjaeger boudin, pork kielbasa. Chicken picanha corned beef pork loin ham hock short loin, prosciutto t-bone jerky shank cupim flank frankfurter leberkas. Prosciutto pork loin tri-tip hamburger, ribeye boudin corned beef salami tail alcatra strip steak meatloaf brisket chuck ham. Pig rump kevin strip steak ham hock swine, tri-tip frankfurter alcatra brisket biltong sausage.</div>

<div class="keyboard-selected">Beef ribs bacon pig andouille ribeye. Pork loin beef pancetta rump, short ribs venison bresaola chislic tri-tip ribeye burgdoggen landjaeger jowl. Pork loin ham capicola spare ribs rump cupim brisket beef ribs. Landjaeger ball tip cupim strip steak pork ham short loin shankle swine biltong short ribs andouille porchetta beef. Rump strip steak landjaeger pig, jowl spare ribs capicola.</div>

<div>Alcatra drumstick short ribs, landjaeger salami jowl bacon. Pastrami shoulder swine jerky, andouille shankle tri-tip ball tip turducken pork alcatra chislic. Doner pork belly ham hock leberkas porchetta spare ribs chuck capicola drumstick beef ribs meatloaf pancetta prosciutto. Leberkas picanha drumstick corned beef. Pork loin turkey kielbasa jowl. Jowl sausage burgdoggen pig corned beef brisket.</div>

This highlight is not visible when the background is purely black:

.keyboard-selected {
  box-shadow: 15px 15px 50px rgba(0, 0, 0, .2) inset;
}

div {
  padding: 10px;
}

body {
  /* black background */
  background-color: rgb(0, 0, 0);
  /* white text */
  color: rgb(255, 255, 255);
}
<div>Bacon ipsum dolor amet leberkas porchetta beef ribs landjaeger boudin, pork kielbasa. Chicken picanha corned beef pork loin ham hock short loin, prosciutto t-bone jerky shank cupim flank frankfurter leberkas. Prosciutto pork loin tri-tip hamburger, ribeye boudin corned beef salami tail alcatra strip steak meatloaf brisket chuck ham. Pig rump kevin strip steak ham hock swine, tri-tip frankfurter alcatra brisket biltong sausage.</div>

<div class="keyboard-selected">Beef ribs bacon pig andouille ribeye. Pork loin beef pancetta rump, short ribs venison bresaola chislic tri-tip ribeye burgdoggen landjaeger jowl. Pork loin ham capicola spare ribs rump cupim brisket beef ribs. Landjaeger ball tip cupim strip steak pork ham short loin shankle swine biltong short ribs andouille porchetta beef. Rump strip steak landjaeger pig, jowl spare ribs capicola.</div>

<div>Alcatra drumstick short ribs, landjaeger salami jowl bacon. Pastrami shoulder swine jerky, andouille shankle tri-tip ball tip turducken pork alcatra chislic. Doner pork belly ham hock leberkas porchetta spare ribs chuck capicola drumstick beef ribs meatloaf pancetta prosciutto. Leberkas picanha drumstick corned beef. Pork loin turkey kielbasa jowl. Jowl sausage burgdoggen pig corned beef brisket.</div>

This can affect browser options as well as addons that provide a dark mode.

Without the highlight, it will not be evident which post will be edited when pressing E.

3
  • Why not simple screenshots for the examples? Why code snippets? Commented Jun 22 at 9:05
  • @ShadowWizard because I thought it's more informative. It's not easy to show that something is highlighted but the highlighting not visible in a screenshot. Moreover, the code directly replicates the issue if anybody is interested. For anybody else it works as well as a screenshot.
    – VLAZ
    Commented Jun 22 at 10:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .