dojo / widgets

:rocket: Dojo - UI widgets.
https://widgets.dojo.io
Other
88 stars 66 forks source link

Upon focusing and blurring a required field there is no response #460

Closed tomdye closed 5 years ago

tomdye commented 6 years ago

Bug

As per dojo 1.x widgets, I would expect an empty blurred required field to highlight red and show a missing required field message. Currently this does not happen.

screenshot 2018-02-02 14 59 14

smhigley commented 6 years ago

There are two separate parts to this:

  1. Validating on blur. The widget itself doesn't control when it validates, and I'm not sure it should. Different designers and developers have different opinions on when validation should happen, and I think it's best left fully controlled. We should probably implement this in examples, though.

  2. Displaying an error message. This seems related to #22. It's definitely something we should implement, but it might not make it to RC.

tomdye commented 6 years ago

I agree that this widget being controlled makes sense, however, I feel that the basic required validation could be done within the widget itself in the event that the widget is set as required, but does not have an onValidate or similar callback passed.

smhigley commented 6 years ago

It actually does receive basic required validation without onValidate, through the magic of native validation :)

The problem is there isn't any default or norm for when a widget should validate. Some people like it on blur, others think the browser default of onsubmit is better. I don't think this is somewhere we should be opinionated.

tomdye commented 5 years ago

This could be done as part by adding native validation to inputs

tomdye commented 5 years ago

closing as outdated