-
-
Notifications
You must be signed in to change notification settings - Fork 104
fix(pat-contentbrowser): Add type='button' to prevent the button to be focused by default in a form #1523
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
base: master
Are you sure you want to change the base?
Conversation
|
Wow, thank you for this fix! I wasn't aware of that. I'll rebase this and merge asap... |
|
note: feel free to assign me as reviewer at any time! then this gets fixed faster 👍🏼 |
…e focused by default in a form
5e8d54d to
5ab8778
Compare
petschki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm ... one thing: I've quickly tested your branch:
✅ hitting enter in the title field with items inside relateditems widget doesn't remove the items anymore
❌ saving the document with focused title field still doesn't work though
do you eventually have time to check that? if not, I'm good to merge this because removing the item is very bad.
|
Hello @petschki, Of course, I’ll take a deeper look on Monday and keep you posted. Thanks again 😄 |
|
I just tested on a fresh Plone site and it's working just fine, I'm able to submit the form by pressing enter while focused on the title. enter_submit_plone_6_2_a2.mp4Here is my version overview I also tried on Plone 6.1.4 (latest release) and it was working as well. |
|
If you do not touch related items its ok. Once you've added them, the submit doesn't work anymore. If you cannot reproduce or do not see a quick solution for that, I'm fine to merge this fix. EDIT: I see you have related items in the video, so maybe its because |
Hello,
This is a small quality-of-life improvement. By adding type="button", the button no longer steals focus in edit/add forms. This also allows users to submit the form by pressing Enter while focused in the title field.
Before this change, something odd happened: pressing Enter while focused in the title field would delete the selected content. If the field wasn’t visible (for example, inside another fieldset), this could lead to accidental deletions without the user even noticing.
Thanks! ✌️