Skip to content
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

Creating an empty template causes a duplicate template to get created. #9104

Closed
nikolajlauridsen opened this issue Oct 7, 2020 · 2 comments

Comments

@nikolajlauridsen
Copy link
Contributor

If you create an empty template and don't click on the editor at all two templates will be created instead of one.

dupe template

Steps to reproduce:

  1. Create a template from the context menu
  2. Give it a name
  3. Click save
    It's very important that you don't click the editor at all, or you will be redirected to the edit page URL, and the bug won't occur.

Additional information

I have a feeling that there is an event that triggers when you click the editor, which also triggers when you click the save button, causing two save actions to start, but this is just a hunch, and the front end code is a foreign place for me, and I dare not venture too far into it 😅

@nikolajlauridsen nikolajlauridsen changed the title Creating an empty template causes a duplicate to get created. Creating an empty template causes a duplicate template to get created. Oct 7, 2020
@nul800sebastiaan
Copy link
Member

I think it happens when the title field loses focus (so when you click the save button), at least that's what I've seen happening before, so it could be that you are able to repro by just giving it a title and then clicking in the code editor. Not sure, but I recall something like that.

@nikolajlauridsen
Copy link
Contributor Author

Ah so that's when it happens, but I think we can close the issue again, this morning I could not reproduce manually, only with cypress tests, so I'm not quite sure what's going on.

But just to clarify, yesterday it would only happen if you clicked the save button directly after entering the name if you clicked anywhere else, and then save button, only one template would be created, it would however still perform the save action twice, once when clicking away from the name field, and once when you clicked the save button, but the save action when clicking the button would just update the existing template as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants