linux trunk build 2000110708. right-click on a bookmark or on a mail in a folder listing in mailnews. Watch it get selected. Worse, select some mails. right-click on a mail. That mail gets selected and the old selection is lost.
17 years ago
Your first statement is bogus. If something is not selected, and it is right-clicked on, it should become selected prior to the context menu being popped up. The second statement is a bug though. A right click should not change the selection if the item clicked on is already selected. Will keep this report open to track that issue. Reassigning to bryner.
bug 47917 is currently open for the point of dropping the multiple-selection on a right-click (although curiously Nav4 on Linux does this annoying thing). However, that bug is being treated as a mailnews thing, but it is really generic to trees (so leaving this as the bug for the base tree binding).
sure, this probably isn't too hard to fix
This should do the trick. jag, can you review, and hyatt, can you sr?
Actually, there is one nuance not handled by this patch, but that can be dealt with as a separate enhancement. If the event.target is not a member of the current selection, then you want to discard the current selection and select the event.target. Only when the event.target is a member of the current selection should that multiple selection be preserved. (At least this is how Mac Finder, Windows Explorer, and GNU Midnight Commander behave).
> selectedItem.length == 0 Plural? (or am I not getting something here).
fixed the typo by removing that clause entirely -- I don't think it's possible to get to that point with no items selected. Also added a clarifying comment.
r=jag on the third patch