1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-12 04:28:21 +00:00

Fix wrong text getting saved on editing second comment on an issue. (#5608) (#5615)

* comments: Fix an incorrent DOM element selection.

This commit fixes a bug that was causing text from previously edited
comment to get saved when two comments were edited one after other.
Text area with id of `#content` isn't unique on the page but it was
being treated as unique by the event handling code.

Fixes: #5581.

* templates: Remove `id` from textarea in commit edit form.

An element is assigned an `id` only if it is unique for the whole page
but in this case there can be multiple textarea so it should have one.
This commit is contained in:
Harshit Bansal
2018-12-31 22:22:06 +05:30
committed by techknowlogick
parent 2631f7f64d
commit 28cc3bd662
3 changed files with 3 additions and 3 deletions

View File

@@ -608,7 +608,7 @@ function initRepository() {
// Setup new form
if ($editContentZone.html().length == 0) {
$editContentZone.html($('#edit-content-form').html());
$textarea = $('#content');
$textarea = $editContentZone.find('textarea');
issuesTribute.attach($textarea.get());
emojiTribute.attach($textarea.get());