Skip to content

Commit 51d1dc2

Browse files
authored
Fix duplicate project board when hitting enter key (#27746)
When hitting the `enter` key to create a new project column, the request is sent twice because the `submit` event and `key up` event are both triggered. Probably a better solution is to rewrite these parts of the code to avoid using native jQuery but reuse the `form-fetch-action` class. But it's beyond my ability.
1 parent 61d94b2 commit 51d1dc2

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

web_src/js/features/repo-projects.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,20 +193,6 @@ export function initRepoProject() {
193193
const url = $(this).data('url');
194194
createNewColumn(url, columnTitle, projectColorInput);
195195
});
196-
197-
$('.new-project-column').on('input keyup', (e) => {
198-
const columnTitle = $('#new_project_column');
199-
const projectColorInput = $('#new_project_column_color_picker');
200-
if (!columnTitle.val()) {
201-
$('#new_project_column_submit').addClass('disabled');
202-
return;
203-
}
204-
$('#new_project_column_submit').removeClass('disabled');
205-
if (e.key === 'Enter') {
206-
const url = $(this).data('url');
207-
createNewColumn(url, columnTitle, projectColorInput);
208-
}
209-
});
210196
}
211197

212198
function setLabelColor(label, color) {

0 commit comments

Comments
 (0)