Fix rotation and selected data loss bug in dialog fragment.