MacOS – When I click and delete a message, how does Mail.app decide which to select next

gmailimapmacosmail.app

In Mail.app (8.2 on Yosemite 10.10.3), when I click a message in the list (preview is on the right) and delete it (using keyboard or mouse), it seems quite random as to whether Mail will move the selection to the message above the one I just deleted:

going up

or the one below:

going down

This often results in my deleting a bunch of messages I didn't mean to as I click the top of a list of e.g. build notifications and hit delete multiple times, expecting it to work down through this list, but instead it moves upwards.

I've tried various things – for example I thought it seemed to correlate with my most recent keyboard navigation in the list – if I hit up arrow, then click a mail, then hit delete it would move up, but it's not consistently that either.

Anyone got an explanation, and preferably a solution?

EDIT: here's a video of it happening. I start a sequence by hitting up arrow and pressing delete, then going click-delete repeatedly, and at the end of the video, the selection changes direction: http://youtu.be/hKq7qA3UgaM

Best Answer

When you click with the mouse button on an item directly above or below the currently selected one, Mail behaves the same way as it would with the down and up arrows on the keyboard.

When you hit the down or up key to select the next item in the list, Mail is programmed so that it remembers your "working direction". Which means when you move the selection one item downwards and delete that item, the selection moves to the next item below the currently deleted item. So this also happens when you click with the mouse on the first item below the currently selected one, which is the case in your video.