A problem with lost data when switching

See the following UI draft:

It allows to preserve existing (“Don’t change”) wallet/contract (if it exists) when saving form data, or create new contract, or connect to an existing wallet/contract by entering its address (that long hexadecimal number). (Not important for my question what wallets and contracts are and what is the differences between wallets and contracts.)

When one switches to “Create” or “Connect to existing” mode, “Wallet or contract address” should be removed, as when we are going to create a contract or “connect to existing” one, the old contract address is no more needed and it would only confuse the user to show the old address.

But if we remove the “Wallet or contract address” value, it would be a data loss.

So variants:

  • Remember it before removing and show it back if the user switches back to “Don’t change” mode. Seems good, but a little cumbersome.
  • Ask confirmation when clicking “Create” or “Connect to existing” radio button. But it is inconvenient to the user to answer a question when he only clicked a radio button.
  • Other.

What to do best?

This seems like the best option for the user.

That said, modals warning users that they will lose data if they leave a screen is a fairly common model these days.

And welcome on board. Glad you’re here. :slight_smile: