@pikapikamart
Posted
Hey, awesome job as well on this one. Layout in desktop looks fine, and the mobile layout as well. Though on the mobile layout, you could have adjust the max-width
of the .container
selector, to be a bit of wider, so that when transitioning to mobile layout, the element is not thin. Also have some padding
to the sides of the body
tag.
Some other suggestions would be:
- Add some
label
for theinput
element, you need this because using onlyplaceholder
won't be much of help, especially when the text are translated into another language, theplaceholder
will stay as it is. That is why you need alabel
to which will have ansr-only
class, so that it will only be visible to screen-reader. It would look like:
<label for={id of the input} class="sr-only" > First Name </label>
Then same goes for other input
element. The sr-only
class will have this tylings:
.sr-only {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
Copy that styling, you will use that a lot.
- On the javascript, you don't need js to change the stylings of the element. For example, you are adding the
error-icon
class right, you could had just use that selector to change the styling of the element, instead of manually using js to change those. Let css handle the css, for js, just apply the class. - Also, when the
input
is wrong, you should add anaria-invalid="true"
on them, letting the user know that theinput
is wrong. Along witharia-describedBy
attribute, to which the value will be theid
of the error-message that has been show. This way, they will know what kind of error they made. I have this simple simple snippet for those , take a look at the html and javascript. You will see howaria-invalid
should be applied and thearia-describedBy
. - Your
button
shouldtype="submit"
, always be explicit to what your control element should be. Because if you just leave it as it is, for example, inside theform
element, you have a closebutton
which will exit theform
, if you don't specify thetype
of thatbutton
, it will default tosubmit
and hence will submit the form, even if you click the closebutton
, in those case, usetype="button"
.
Aside from those, great work on this one. I like that shake animation , that's a first I guess for me to see, looks cool.
Marked as helpful
@syzwnftr
Posted
@pikamart Hey, thank you for this thorough feedback as well. I learn a lot from this feedback and the other one as well. There are some thing that you said in this feedback that I didn't know and haven't discover yet, and I'm excited to start digging about it.
Anyway, thanks again for your time and effort to write this feedback. Cheers!