Bug 132142

Summary: Focusing on text inputs with .focus() should move the cursor to the end.
Product: [Applications] konqueror Reporter: Tim Hutt <tdhutt>
Component: khtmlAssignee: Konqueror Bugs <konqueror-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: finex
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Move cursor to end after the input field received focus

Description Tim Hutt 2006-08-09 14:32:18 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Ubuntu Packages

Simple bug (probably almost wishlist), but when you so something like this:

<html>
<head>
	<script type="text/javascript">
		function select()
		{
			document.getElementById("query").focus();
			return false;
		}
	</script>
</head>

<body onload="select();">
	<form action="index.cgi" method="GET">
		<input type="text" id="query" name="query" value="Some initial text."/>
	</form>
</body>
</html>

Then the input cursor appears at the start of the text edit, when it should be at the end (most often you want to append text, not prepend it). Firefox does it correctly.

Just a slight annoyance - probably very easy to fix.
Comment 1 Harri Porten 2007-02-10 12:19:15 UTC
It is easy to fix (see patch). But do all other browser agree? The test in my (slightly dated) IE had a different result.
Comment 2 Harri Porten 2007-02-10 12:20:40 UTC
Created attachment 19603 [details]
Move cursor to end after the input field received focus
Comment 3 FiNeX 2010-09-19 15:55:43 UTC
The testcase is still valid with KDE 4.4.5.

The patch should be updated for KDE 4.
Comment 4 Justin Zobel 2021-03-21 00:26:00 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 10 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 5 Christoph Cullmann 2024-05-06 18:38:08 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann