Opened 11 years ago

Closed 11 years ago

#12978 closed defect (fixed)

dijit.form.Select: validate() tooltip displaying confusion.

Reported by: zimnyx Owned by: bill
Priority: high Milestone: 1.7
Component: Dijit - Form Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:


I got form with a few select inputs (empty default value, required=true), and form.validate is bind to onSubmit.

When I click submit, form validation happens and validate is run for every Select:

  • Select.message is set
  • dijit.hideTooltip() is called
  • dijit.showTooltip() is called

As only one tooltip can be displayed at a time, only last one is visible.

Now I choose a value for all but first select and click submit again. Form.validate() is run again: 1st Select (has empty value):

  • dijit.hideTooltip() not is called
  • dijit.showTooltip() not is called

Other Selects (values provided):

  • Select.message is set
  • dijit.hideTooltip() is called
  • dijit.showTooltip() is not called

As a result we don't see any tooltip, cause hide/showTooltip() wasn't called for 1st Select. It's confusing.

Change History (4)

comment:1 Changed 11 years ago by Douglas Hays

Component: Dijit - FormDijit
Owner: changed from Douglas Hays to bill

Dialog needs to be more aware of child Tooltips. Run test_Select.html and click the "show dialog" button at the bottom. Then click the "validate and close" button in the Dialog that pops up. A tooltip will appear. Click the X to close the Dialog and retry. No more tooltips.
Now add a 2nd Select to the Dialog and retest. When you close the Dialog by clicking the X, the tooltip remains even though the Dialog closes.

comment:2 Changed 11 years ago by bill

See also [25493], I guess it needs more work.

comment:3 Changed 11 years ago by bill

Component: DijitDijit - Form
Milestone: tbd1.7
Status: newassigned

Actually, the only issues are with the Select widget, but I'll check in a fix.

comment:4 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [25657]) Fixes to Select validation:

  • Make Select.state either "" or "Incomplete", not "Error", to match behavior of other form widgets.
  • Update Select.state according to Select.required and Select.disabled. (The state is "Incomplete" whenever required == true, disabled == false, and no value is selected.)
  • Fix display of validation tooltip so it appears on the second focus, same as other form widgets work.

Fixes #12977,#12978 !strict.

Note: See TracTickets for help on using tickets.