Fixed input length issue and text selection