use-ink / contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
https://contracts-ui.substrate.io/
GNU General Public License v3.0
61 stars 45 forks source link

Number Input can not be Empty #443

Open peetzweg opened 1 year ago

peetzweg commented 1 year ago

Describe the bug The default value of a number input during contract interaction can not be removed. It seems the there always needs a value to be present. See demo down below.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://contracts-ui.substrate.io/
  2. Use a contract with a message which requieres a number parameter
  3. Try to erase the default value of 0 with a backspace

Expected behavior I'm able to clear the default input value with a backspace to enter the number I want. Currently I have to move the caret to the start to remove the zero once I've entered the desired amount.

Screenshots

demo

Desktop (please complete the following information):

Environment (please complete the following information where it makes sense):

I've used a PSP34 contract generated using the wizard on https://openbrush.io/ .

peetzweg commented 1 year ago

@statictype can you confirm this is unintended behavior?

statictype commented 1 year ago

this normal behaviour for the html number input. if we don't want it we need to change to type="text"

peetzweg commented 1 year ago

Ah okay, this could be it. I find it quite awkward behaviour. Should we fix this than?

gaboesquivel commented 1 year ago

@statictype should we close this ?