-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
feat: add auto-focussing via URLSearchParam to content-manager #17613
Conversation
Size Change: +427 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
6967872
to
4ad315c
Compare
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.
Very nice hook and refactoring! 🚀 Could you maybe document a few field
params that might work to be able to do QA?
packages/core/admin/admin/src/content-manager/components/RepeatableComponent/index.js
Outdated
Show resolved
Hide resolved
I've updated the description for the PR if you want to do some manual QA. |
I've done some manual QA:
All other fields work really well 🚀 |
the field receives focus, the issue is the field imo. You either have it filled or not filled, in the case of not filled the button to add elements is nested deeply inside the field but if it's filled the first action is the one that gets focus (when you tab through the page) this inconsistency is difficult to deal with to be honest. IMHO it's a design issue that needs a rethink, e.g. could the whole field always be "seen" as a button so you can focus the whole thing and pressing enter lets you change the image etc. So for now, we focus the field and the first time you press
Really? I've just tried it and it works, this is my path |
0b87583
to
f78dedd
Compare
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.
Very cool, this works well for me!
f78dedd
to
b6e4158
Compare
feat: add fieldRef to fields in GenericInput refactor: custom inputs to be focussed docs: add documentation for useFieldInputFocus hook feat: work with CM specific components feat: auto-open repeatable components feat: make wyiwyg editor focusable chore: fix other test suites test: add generic input tests for auto-focussing chore: add comment for not supported Update packages/core/admin/admin/src/content-manager/components/RepeatableComponent/index.js Co-Authored-By: Gustav Hansen <gustav.hansen@strapi.io>
b6e4158
to
113b53b
Compare
sorry @jhoward1994 i had to rebase 🙏🏼 |
What does it do?
useFocusInputField
hook exposed via thehelper-plugin
useFocusInputField
hook to auto-focus in the content-manager inGenericInputs
useFocusInputField
hook to auto-focus relation fields in the content-managerWYSIWG
to be able to auto-focusRepeatableComponent
if the field we want is located insideWhy is it needed?
How to test it?
OR
field=<name>
as a query param e.g.short_text
ortimestamp
orcustom_field
cats.0.categories
repeatable_compo.1. name
Related issue(s)/PR(s)