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

Adding a non-existent tag to a chapter requires to save twice. #3931

Closed
Pafzedog opened this issue Dec 27, 2022 · 9 comments
Closed

Adding a non-existent tag to a chapter requires to save twice. #3931

Pafzedog opened this issue Dec 27, 2022 · 9 comments
Labels
Milestone

Comments

@Pafzedog
Copy link

Describe the Bug

When adding an unknown tag to a chapter, the first click on the save button does not work properly.

Steps to Reproduce

  1. Go to a chapter
  2. Edit the chapter
  3. Add an un-existing tag
  4. click on "Save chapter"
  5. A new "Tag field" appears under the previously entered tag.
  6. Chapter and new tag are not saved

Expected Behaviour

Chapter is saved and also the new Tag

Screenshots or Additional Context

image
image

Browser Details

102.6.0esr (64 bits) on Windows

Exact BookStack Version

22.11 and actual demo version

PHP Version

7.4.33

Hosting Environment

Debian 11 LXC on proxmox
manual installation with nginx

@ssddanbrown
Copy link
Member

Just tried to replicate on our demo instance, using Firefox 107.0.1 on MacOS, and could not get the issue to occur.
Will need to check specifically against ESR.

@Pafzedog
Copy link
Author

strange ...
I just tried with Edge browser on your demo instance and same behaviour
image

I'll try later with another computer and also another network

@linyiman
Copy link

good

@linyiman

This comment was marked as spam.

@Pafzedog
Copy link
Author

Just tested it on another computer and another network and it's same behavior.
let met explain further :
Page and Tag will not be saved unless, before clicking on "Save button", I click in "Tag Value" field or anywhere else. There is some kind of "trigger event" that validate the entry and display a new row to add another tag as I click eveywhere and obviously on the "Save" Button.

@ssddanbrown
Copy link
Member

@Pafzedog Thanks for testing further.

Just tested this again on chromium Version 109.0.5414.74 (Official Build) snap (64-bit) and Firefox 109.0 (64-bit) on Linux, across both my dev instance and the demo instance and still cannot reproduce.

I'm also was not ever, without hacking, able to submit the form without triggering the new row to display. I'd click the save button but it would jump from the cursor due to the new row popping in.
Even when doing some hacker to submit the form while I'm still in the tag name input, the value would submit as expected, which meets my expectations since the tag inputs should always have a valid name assigned, and it's just using normal HTML form functionality, so they'd be part of the form submission.

@Pafzedog
Copy link
Author

Don't you have to click twice on save button when adding a brand new tag ?
firefox_8bfxakXfcW

@ssddanbrown
Copy link
Member

Oooooh, I totally understand you now, sorry for the confusion. I thought you meant the chapter was saved but the tag was not.
Yeah, technically you are never actually clicking the button in the above steps, it moves before you have the chance to complete the click.

Might have to tweak this to add the new row sooner, when input is is started for the previous tag rather than on un-focus.

ssddanbrown added a commit that referenced this issue Jan 26, 2023
Prevented interferance with the user's action if they interacted with
something below the tags, since a new row would be added on blur and
hence shift down positions.

For #3931
@ssddanbrown
Copy link
Member

Thanks again @Pafzedog for reporting this. I've now pushed 3202f96 which will add the row on input change, long before moving to press the button.
Will be part of the next feature release.

@ssddanbrown ssddanbrown added this to the v23.01 milestone Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants