datepicker('setDate', ...) causes datepicker to appear and not be hideable

datepicker('setDate', ...) causes datepicker to appear and not be hideable


I have a date selection field that can also be automatically updated
via other options (for example a "last two weeks" text link) and so I
need to call datepicker('setDate'...) behind the scenes to keep it
synced with this selection. But after setting the date, setData also
triggers to datepicker to appear, in its expected position, but such
that datepicker('hide') and the visible "close" button will not make
it disappear!
Is this the intended behavior? Is there a way to avoid it?
I've cut the example down to the following bare minimum:
html:
<input id="start-date"/>
js:
$("#start-date").datepicker();
This works absolutely fine and as expected. If we go into firebug and
try to set the date and not show the datepicker:
$("#start-date").datepicker('setDate', start-date).datepicker('hide');
The datepicker flies up and cannot be closed by the javascript blur()
or datepicker('hide') or by the interface "close" button, but only if
another datepicker on another form element is triggered.
I would appreciate assistance.
Thank you,
Adam