What happens to the ESOP cost basis of shares owned after an S election?

As a C corporation the distributions reported on 1099-R showed an ordinary income amount for the cost basis amount and a capital gain on the appreciated value.

If the S election changes ESOP distributions to "cash only" distributions do the old long-term employees with much appreciation lose the capital gain treatment of their holdings? With the S election are they now required to categorize their distributions as ordinary income? Or do we still need to track the cost basis of their shares as an S corp owned ESOP?

Thank You in advance,

TW