Fix file selection when using tabs to select files

Fixed #2855

review: @devoncarew