Fixed a issue of the selected item is not returned when the dialog is cl...

...osing.