Changing labels while editing issue kills your changes. #4043

Closed
opened 2025-11-02 05:35:23 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @Jaffex on GitHub (Oct 1, 2019).

Description

If you change the labels of an issue while you're editing its text, your changes will disappear after closing the label-selection dialogue.

Screenshots

example

Originally created by @Jaffex on GitHub (Oct 1, 2019). - Gitea version (or commit ref): 1.10.0+dev-352-g7ff783b73 (Tested on try.gitea.io) - Can you reproduce the bug at https://try.gitea.io: - [X] Yes (https://try.gitea.io/jaffex/test/issues/1) - [ ] No - [ ] Not relevant ## Description If you change the labels of an issue while you're editing its text, your changes will disappear after closing the label-selection dialogue. ## Screenshots ![example](https://user-images.githubusercontent.com/31133207/65973708-13205e00-e46c-11e9-813c-5477773e3dd7.gif)
GiteaMirror added the topic/uiissue/confirmedtype/bug labels 2025-11-02 05:35:23 -06:00
Author
Owner

@bagasme commented on GitHub (Oct 2, 2019):

Please give more details (Git version on your server, your OS, etc).

@lunny shouldn't this issue a bug?

@bagasme commented on GitHub (Oct 2, 2019): Please give more details (Git version on your server, your OS, etc). @lunny shouldn't this issue a bug?
Author
Owner

@Jaffex commented on GitHub (Oct 7, 2019):

On my own server, here's the specs:

  • Gitea version (or commit ref): 1.9.0
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
@Jaffex commented on GitHub (Oct 7, 2019): On my own server, here's the specs: - Gitea version (or commit ref): 1.9.0 - Git version: 2.7.4 - Operating system: Ubuntu 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite
Author
Owner

@blueworrybear commented on GitHub (Oct 12, 2019):

Hi, it seems to me that the issue is caused by function initListSubmits(selector, outerSelector).

As codes below show, the web page is forced to reload each time the dropdown menu hide. I think it's because assignee and milestone are render in server side. To update those information, the original codes force to reload the whole page.

$('.' + selector).dropdown('setting', 'onHide', function(){
    hasLabelUpdateAction = $listMenu.data('action') == 'update'; // Update the var
    if (hasLabelUpdateAction) {
        const promises = [];
        Object.keys(labels).forEach(function(elementId) {
            const label = labels[elementId];
            const promise = updateIssuesMeta(
                label["update-url"],
                label["action"],
                label["issue-id"],
                elementId
            );
            promises.push(promise);
        });
        Promise.all(promises).then(reload);
    }
});

Since all labels are loaded to web page by default and could be shown/hided with JavaScript, it's not necessary to reload. Therefore there maybe two options to fix this issue:

  1. Prevent reloading if selector equals to select-label

    Although this could quickly fix the issue for updating labels, updating milestone and assignee would still kill editing content.

  2. Move some server-side render content to front-end. (This may take more effort to do so 😅 )

Please let me know what you guys think. I could try to fix this issue. 😄

@blueworrybear commented on GitHub (Oct 12, 2019): Hi, it seems to me that the issue is caused by `function initListSubmits(selector, outerSelector)`. As codes below show, the web page is forced to reload each time the `dropdown` menu hide. I think it's because **assignee** and **milestone** are render in server side. To update those information, the original codes force to reload the whole page. ```js $('.' + selector).dropdown('setting', 'onHide', function(){ hasLabelUpdateAction = $listMenu.data('action') == 'update'; // Update the var if (hasLabelUpdateAction) { const promises = []; Object.keys(labels).forEach(function(elementId) { const label = labels[elementId]; const promise = updateIssuesMeta( label["update-url"], label["action"], label["issue-id"], elementId ); promises.push(promise); }); Promise.all(promises).then(reload); } }); ``` Since all **labels** are loaded to web page by default and could be shown/hided with **JavaScript**, it's not necessary to reload. Therefore there maybe two options to fix this issue: 1. Prevent reloading if `selector` equals to **select-label** > Although this could quickly fix the issue for updating labels, updating **milestone** and **assignee** would still kill editing content. 2. Move some server-side render content to front-end. (This may take more effort to do so 😅 ) Please let me know what you guys think. I could try to fix this issue. 😄
Author
Owner

@stale[bot] commented on GitHub (Dec 11, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Dec 11, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@brupelo commented on GitHub (Apr 7, 2020):

Related issue: https://github.com/go-gitea/gitea/issues/11004

@brupelo commented on GitHub (Apr 7, 2020): Related issue: https://github.com/go-gitea/gitea/issues/11004
Author
Owner

@jolheiser commented on GitHub (Mar 17, 2023):

This should be partially fixed by https://github.com/go-gitea/gitea/pull/23014 in that a confirmation dialog comes up before a reload. Just mentioning here to aid tracking.

@jolheiser commented on GitHub (Mar 17, 2023): This should be partially fixed by https://github.com/go-gitea/gitea/pull/23014 in that a confirmation dialog comes up before a reload. Just mentioning here to aid tracking.
Author
Owner

@lunny commented on GitHub (Apr 26, 2023):

This should be resolved by #23876

@lunny commented on GitHub (Apr 26, 2023): This should be resolved by #23876
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4043