-
Notifications
You must be signed in to change notification settings - Fork 447
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
After Random characters in autosuggest field for categories, you'll get directly the XHR response #9884
Comments
…hin form with one input
This was interesting to track down. Apparently there is some default browser behaviour specifically on form with one field. So hitting enter in that one field was automatically submitting the form, which was causing to display the endpoint where the form was pointing to. But additionally if there is form with one input and some button - it will hit the button automatically?! So additional to the report, what was happening is that if you would enter valid category and than you would type something that does not exist and hit enter - it clicked on the 'remove' button of the previous category just based on that there is SOME button in the form.. Can't be more confusing than that. What seems to be effective way to prevent it is just discard such enter event on the form level. I did test it with chrome, safari and firefox, so hopefully its good fix. @jonasraoni Can you please do the code review? Will check whether same problem is on 3.3 and main branch. 3.4.0 PR |
…hin form with one input
…hin form with one input
3.3 is using legacy form with checkboxes, so not relevant in that particular use case, but it can be problem in other vue.js form which would have just one FieldText for example Therefore adding same improvement for 3.3 pkp/ui-library#383 And same thing for main - its not problem in this particular scenario, because the autocomplete component from headless-ui does not let propagate enter event. But its misbehaving for example with simple FieldText. After the code review I will also cherry pick it to the main branch. |
Yeah, this behavior is old. I agree with the fix 😁 The worst was the backspace behaving as a back button 🥲 |
…hin form with one input (#381)
…hin form with one input (#383)
…hin form with one input (#381)
Merged to 3.3 and 3.4 and cherry-picked to main. Thanks @jonasraoni |
After this change it is not possible to enter a new line in the field References. Removing Note:
... to solve this in the context of this original issue report... making sure that both scenarios works... |
So this is alternative I came up with. Reasoning behind this is that we don't rely on submit event at all. We use normal button to submit form, which triggers our custom vue.js event. Therefore just preventing default behaviour on submit should be safe and it prevents the scenario, when there is one input and no button in the form to automatically triggers submit event and therefore open the 'action' url. But thats not enough. As mentioned above - if there is one input and some button - it will automatically click on that button - no matter what that button does. So for example in categories autocomplete it was removing the categories on entry, because the remove icons are buttons. Therefore also added And this new solution is not interfering with hitting enter - which cause that issue in textarea that @bozana mentioned. I did various testing across browsers and versions. So hopefully this is solid solution. I will need two approvals for 3.3 and 3.4, can I ask @blesildaramirez and @ewhanson ? main: 3.4: 3.3 Note from Blessie: OJS test links have been changed due to correction on commit message, to point to correct branch names in ui-library. The ui-library branches are from Jarda's original branch, just making sure the tests in OJS points to intended changes in ui-library for accurate testing runs. |
Test for main are failing.. let me check whether its all rebased |
All tests are passing now. |
…4_stable-3_4_0##
…4_stable-3_3_0##
#432) * pkp/pkp-lib#9884 Second attempt to override default behaviour for one input forms * pkp/pkp-lib#9884 Add explanatory comment to dummy submit input
#434) * pkp/pkp-lib#9884 Second attempt to override default behaviour for one input * pkp/pkp-lib#9884 Add explanatory comment to dummy submit input
#433) * pkp/pkp-lib#9884 Second attempt to override default behaviour for one input * pkp/pkp-lib#9884 Add explanatory comment to dummy submit input
All merged (except submodules which will be handled separately), thanks! |
pkp#432) * pkp/pkp-lib#9884 Second attempt to override default behaviour for one input forms * pkp/pkp-lib#9884 Add explanatory comment to dummy submit input
Describe the bug
During th submission process, when you have more than 10 categories, a autosuggest field is used. And if you enter some random characters in and hit Enter, you'll get the result of XHR request.
To Reproduce
What application are you using?
OJS 3.4 testdrive
The text was updated successfully, but these errors were encountered: