craftcms / craftcms/cms

Add option in config for disabling autofocusing text fields in matrix fields

Open
#3,306 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug severity:minor
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

When adding new matrix block, first text field of that block gets focused.
Sometimes this behavious can be counterproductive - for example when first text field is in the middle of block , with many other fields before it.
When text field gets focused, fields before it are hidden - because page scrolls to this text field, leaving other fields behind.

Therefore, i propose adding simple boolean variable to config, that would be able to disable this functionality.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating the matrix-field behavior that focuses the first text field when a block is added, then trace how configuration options are defined and read. Done means a boolean configuration option can disable this autofocus behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.