In this post, I will show you how I fixed a small bug in my contact form, which I built in React. At first I tried to use <type=”number”>
and here is what I got.
Then I found out that there is an <input> element which has a type=”tel” and you can use it with a pattern.
So when I am trying to use a string or more numbers after applying it an error shows up.
I got a feeling of shame when I discovered it. But last time I am trying to adopt a growth mindset and feel joy when I make a mistake because It helps me to learn something new.