The question on Quora was:

What evolved first in bats, flight or echolocation?

My answer was:

It’s not clear. A 2010 paper suggested that the oldest known fossil bat was capable of echolocation.  Earlier work on the same fossil had argued that it did not echolocate, which would have been evidence that flight came first.  But if this bat ancestor did indeed echolocate, the answer becomes unclear:

The relationship between echolocation and flight in the origin and adaptive radiation of bats remains a topic of discussion. Presently there are three schools of thought: the first proposes that echolocation evolved before flight, the second proposes that flight evolved before echolocation and the third proposes that flight and echolocation evolved synchronously. … Our data do not resolve these questions …

A bony connection signals laryngeal echolocation in bats

A large group of modern bats (the megabats) do not echolocate, but that doesn’t help resolve the question; it could be that echolocation arose after mega- and microbats diverged, but it’s equally possible that megabats lost the ability to echolocate after they diverged.  Since non-flying mammals (e.g. shrews) are capable of some echolocation, there’s no reason to believe that flight had to precede echolocation.

A more recent study on bat relationships finds hints that echolocation arose multiple times in bats, which would argue that flight came first, but even this study can’t clearly determine whether echolocation arose multiple times or was lost in some groups:

… our findings prove without doubt that the evolution of laryngeal echolocation in bats has involved either multiple acquisitions or an evolutionary loss in Old World fruit bats

Phylogenomic Analyses Elucidate the Evolutionary Relationships of Bats