(2.7x) backport r13940 to fix bug #5270 in 2.7x
(qt) #5270 'Details > Comment field loses selection': fixed