fix tab position calculation for next item