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

[5.x]: Field translatable indicator and action menu triggers are autofocused #16528

Open
mmikkel opened this issue Jan 25, 2025 · 1 comment
Open
Assignees
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Jan 25, 2025

What happened?

Description

In some cases where autofocus is expected to be set on the first input in a field layout – e.g after creating new nested entries in a Matrix field, or when opening an element in a slideout – Craft will instead autofocus the first field's translatable indicator (triggering its tooltip).

If the first field is not translatable, but has a field actions menu, Craft will put autofocus on the action menu's disclosure trigger instead.

CleanShot.2025-01-25.at.19.39.48.mp4
CleanShot.2025-01-25.at.19.53.13.mp4

(☝ ...note the t9n indicator tooltip rendering behind the slideout in the bottom screencast; creating another issue for that 🙂)

Steps to reproduce

  1. Create a Matrix field. Use the inline-editable mode. Add an entry type where the first field is a translatable Plain Text field.
  2. Add the Matrix field to an entry type's field layout.
  3. Create a new nested entry in the field, and observe that Craft will auto-focus the new nested entry's first field's translatable indicator; triggering its tooltip.

OR

  1. Create an entry where the first field in the layout is translatable
  2. Open that entry in a slideout
  3. Observe that the autofocus is set to the first field's t9n indicator

Expected behavior

When creating new nested entries or opening elements in slideouts, autofocus should be set on the first field input, not on translatable indicators or field action menu triggers.

Actual behavior

If the first field in a field layout is translatable or has a field actions menu, Craft will autofocus the t9n indicator or action menu trigger instead of the field's input.

Craft CMS version

5.6.1

PHP version

No response

Operating system and version

macOS 14.6.1, MS Edge 131.0.2903.112

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

None

@i-just
Copy link
Contributor

i-just commented Jan 27, 2025

Hi, thanks for reporting! I raised a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants