Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus title input when clicking helper link #4696

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ String.prototype.endsWith = function (pattern) {
}
})(jQuery);


function setSimpleMDE($editArea) {
if (codeMirrorEditor) {
codeMirrorEditor.toTextArea();
Expand Down Expand Up @@ -1660,6 +1659,7 @@ function initWipTitle() {
e.preventDefault();

var $issueTitle = $("#issue_title");
$issueTitle.focus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to focus field after value has been set

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I do that, then the cursor will be at the beginning of the input. By focusing before changing the content of the field, I make sure that my cursor will be at the end of it, which is preferable i think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should be at the end. For me it worked also if focused after value is set but ok, NVM than :)

var value = $issueTitle.val().trim().toUpperCase();

for (var i in wipPrefixes) {
Expand Down