mozilla-b2g/gaia — pull request #15824 by jrburke (2014-01-30 00:51:16+00:00)
Title: Bug 964530 - [B2G][Email] non-folders are selectable

Some background on the cause of the bug:

Cards.folderSelector() in mail_common shows a list of folders as what would be displayed in the folder_picker. However, some folder entries, like [Gmail], are not actually selectable since they are just for hierarchical display purposes, not real folders.

However, email's value_selector does not check if folder.selectable is true, and allows any item to be tapped. This leads to a bad folder getting passed to the back end, and the back end blows up.

This pull request modified value_selector to not allow clicks for non-selectable folders. It seems desirable to show the hierarchy in the value_selector, so that it matches the display in the folder_picker card, but similar to that card, those items do not trigger any actions if they are tapped.

A deeper fix could be to also have the back end recover if this sort of data is passed to the back end and not to get stuck, but some front end fix is needed regardless, to give better feedback to the user.