jtsage/jquery-mobile-datebox — Issue #104: Datebox triggers change event when opened
Author: wvenable
Created: 2011-10-28 18:53:05+00:00
State: open

I'm hoping this can be changed since I'm currently changing a few lines in every release to get around this minor issue. The problem is on line 1743 (in the open method):

this.input.trigger('change').blur(); // Grab latest value of input, in case it changed

This triggers the change event on the attached element whenever the datebox is opened but the data hasn't changed. This causes problems for code I have attached to the change event of the textbox -- I need the event to fire only when the data has actually changed. I replace that line with the following:

// Grab latest value of input, in case it changed
self.theDate = self._makeDate(self.input.val());
self._update();
this.input.blur();

Which does the same work but without triggering the change event.

Thanks,