Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9389 closed defect (fixed)

SimpleTextArea's onInput stops an event that may not be present

Reported by: Ben Lowery Owned by: anonymous
Priority: high Milestone: 1.4
Component: General Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:


_onInput: function(e){
		// Override TextBox._onInput() to enforce maxLength restriction
			var maxLength = parseInt(this.maxLength);
			var value = this.textbox.value.replace(/\r/g,'');
			var overflow = value.length - maxLength;
			if(overflow > 0){

The event may or may not be passed, as subclasses, like Textarea, call _onInput to do other input validation, not in the context of an event that needs stopping. We should check to make sure e is provided before stopping it.

Change History (3)

comment:1 Changed 13 years ago by Ben Lowery

Resolution: fixed
Status: newclosed

(In [17852]) fixes #9389. check for existance of event before stopping it.

comment:2 Changed 13 years ago by bill

(In [17854]) Use brackets for if() statement as per coding standards. Refs #9389.

comment:3 Changed 13 years ago by Adam Peller

Milestone: tbd1.4
Note: See TracTickets for help on using tickets.