Fixed issue with resizing where selected index was forgotten