-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
When the title in the issue has a value, set the text cursor at the end of the text. #30090
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
Changes from 3 commits
a359c00
ae9d4f1
8dee76b
9eeab81
980fc8c
27efe8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,6 +331,14 @@ export function initRepoIssueReferenceRepositorySearch() { | |
}); | ||
} | ||
|
||
export function initRepoIssueTitleFocus() { | ||
const issueTitle = document.getElementById('issue_title'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of hard-coding
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we could keep the DOM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it's possible to detect autofocus in JS. One could install a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah no I think trying to detect autofocus is a hopeless effort. Would suggest to follow @wxiaoguang and add this simple class that will manually focus the first matching element on page load. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
if (issueTitle) { | ||
issueTitle.focus(); | ||
issueTitle.setSelectionRange(issueTitle.value.length, issueTitle.value.length); | ||
} | ||
HEREYUA marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
export function initRepoIssueWipTitle() { | ||
$('.title_wip_desc > a').on('click', (e) => { | ||
e.preventDefault(); | ||
|
Uh oh!
There was an error while loading. Please reload this page.