Improved behavior of CustomTree.enableClickToExpand().

Change-Id: I5857482ac9b70b66df0b7111354397a1c57dc5b3