Dialog buttons disappear when dialog is dragged

Dialog buttons disappear when dialog is dragged

When I add buttons to a dialog dynamically, e.g.,
 
  1. $("#sheetwizard").dialog("option", "buttons", {
  2.   "Next": function() {
  3.     showDocumentWindow();
  4.   }
  5. });
 
the buttons disappear when the dialog is dragged. This only happen when:
 
1) the buttons are added dynamically, and
2) after the dialog is opened.
 
If the dialog is physically closed and then opened the buttons reappear.
 
Is this a bug or am I doing something wrong?