Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#7994 closed defect (fixed)

dijit.form.ValidationTextBox calls validator function twice onBlur

Reported by: s_i_z_o Owned by: Douglas Hays
Priority: high Milestone: 1.3
Component: Dijit - Form Version: 1.2.0
Keywords: ValidationTextBox validator onBlur Cc:
Blocked By: Blocking:

Description

Some events on dijit.form.ValidationTextBox? fire more than one call to validator function.

  1. onBlur, validator function is called twice. It works either with TAB or click outside field.
  1. onFocus, when entering with Shift-TAB, it is called three times. Twice onFocus event and third time on release of Shift.
  1. Some keystrokes like Ctrl or Shift alone, produce call to validator while content of the field was not changed.

Maybe it would be better for the call to validator function only to be fired on actual value change?

Same defect also exists in 1.1.1

Attachments (2)

example.html (1.5 KB) - added by s_i_z_o 11 years ago.
Test case to reproduce this error
7994.patch (1.7 KB) - added by haysmark 11 years ago.
Fixes #7994. Eliminated redundant calls to the validator. Moved ValidationTextBox?-specific code out of TextBox?.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by s_i_z_o

Attachment: example.html added

Test case to reproduce this error

comment:1 Changed 11 years ago by Adam Peller

Milestone: 1.2.1tbd
Owner: set to Douglas Hays

comment:2 Changed 11 years ago by Douglas Hays

Milestone: tbd1.3

Changed 11 years ago by haysmark

Attachment: 7994.patch added

Fixes #7994. Eliminated redundant calls to the validator. Moved ValidationTextBox?-specific code out of TextBox?.

comment:3 Changed 11 years ago by Douglas Hays

Status: newassigned

comment:4 Changed 11 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [16424]) Fixes #7994. Removed some extraneous validate() calls. Removed some template attachevents to onfocus and onblur in preference to using _onFocus and _onBlur. Added onChange(undefined) event when the user textbox input is invalid and onblur event fires (previously no event fired).

comment:5 Changed 11 years ago by Douglas Hays

(In [16431]) References #7994. Check for no event argument to _onInput in the case of Textarea resizes.

comment:6 Changed 11 years ago by Douglas Hays

(In [16432]) References #7994. Reformat the textbox input onfocus.

comment:7 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.