Comments (8)
I've rephrased the title. The focus helper used for dialogs and drawers to set the focus on open should also consider other fields/inputs than the native elements listed in https://github.com/getkirby/kirby/blob/main/panel/src/helpers/focus.js#L28-L37
Technically, button is listed in this selector list which the tags list includes. However, since there are native inputs from other fields present in the drawer as well, those will receive preference currently.
from kirby.
I think this is not related autofocus: true
. First field should be focused in the form without autofocus
but doesn't working for some fields (structure, object, blocks and layout). For ex: if first field is text field, it's working. But if first field is blocks field, it doesn't focus to blocks field.
from kirby.
Not sure this is bug or intended but not just for tags field, same for also structure, object, blocks and layout field.
from kirby.
@mrflix You can specify which field should be automatically focused on the field properties:
autofocus: true
https://getkirby.com/docs/reference/panel/fields/text#field-properties
Please note: Only the first field with this name is considered.
from kirby.
Thanks for the hint, Gerrit. I added autofocus: true
to the first field (role) and that made the second field (name) autofocus when adding a new row to the structure O_o
from kirby.
Of course, this is not the purpose of the autofocus option if it does not work. Let's wait and see what the developers have to say.
from kirby.
I added autofocus: true to the first field (role) and that made the second field (name) autofocus when adding a new row to the structure
I cannot reproduce this.
When I add
credits:
type: structure
fields:
role:
type: tags
autofocus: true
name:
type: tags
website:
type: url
Without setting an explicit autofocus, dialogs and drawers will attempt to focus the first element from this list of selectors:
"[autofocus]",
"[data-autofocus]",
"input",
"textarea",
"select",
"[contenteditable=true]",
"[type=submit]",
"button"
Since the tags field/input is rather special, the native input
element of the text fields grabs the focus instead.
from kirby.
I can't replicate the bug either. autofocus: true
on role works. Thanks for taking the time to test it @distantnative
Since the tags field/input is rather special, the native input element of the text fields grabs the focus instead.
For me it was a very unintuitive experience that the third field received focus when I added a new line. The fields are sorted in order of importance and I always want to fill in the first field first.
from kirby.
Related Issues (20)
- [Panel] Dragging a file from a file section into a writer field stores the panel file url HOT 1
- [Panel] Long page title pushes the prev/next page navigation out of view HOT 3
- Resize/crop/thumb functions see longest size of images as width HOT 5
- [Panel] Switching Languages triggers revert / save HOT 2
- Use `slugs.maxlength` when generating slugs HOT 1
- `convert` command deprecated
- Slower navigation requests still go through even if already navigated elsewhere
- Files & Pages field: singular empty text when multiple: false HOT 2
- Media file not deleted after status change HOT 1
- Table layout pages section: interactive previews are not updating content HOT 1
- [Panel] Pattern setting is ignored in some cases HOT 4
- Classes added by Custom Nodes are stripped out of the Writer field when refreshing the page/ProseMirror re-rendering the Writer HOT 2
- Performance issue: slow pages section with table layout
- Sorting doesn't work as expected if some pages have fixed nums HOT 6
- Page creation dialogue: "add" button is no longer displayed [regression] HOT 1
- IDE support for `Filesystem\Asset` proxied methods HOT 2
- Focus on Blocks is not removed when focus switches to other field
- Change URL dialog: not displaying language URL prefix
- `Html::tag` does not accept whitespace for attributes HOT 3
- Multilingual registration auth code template is not translated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby.