Refactoring and adding check on becomeFirstResponder for placeholder visibility.