Autofocus GitHub import URL, submit with Enter

This commit is contained in:
Fred Sauer committed 2026-04-17 16:50:15 -07:00
1 parent fd4a6f8401
commit 137de06e54
1 file changed
+4
+4
View File
@@ -94,6 +94,10 @@ export function _importProjectFromGithub(e) {
var modal = $("#importGithubModal");
var btn = $("#importGithubButton");
modal.modal('show');
modal.off('shown.bs.modal').on('shown.bs.modal', () => $("#importGithubURL").trigger('focus'));
$("#importGithubURL").off('keydown').on('keydown', (e) => {
if (e.key === 'Enter') { e.preventDefault(); btn.trigger('click'); }
});
btn.off('click').on('click', () => {
var githuburl = $("#importGithubURL").val() + "";
modal.modal('hide');