Cms: Creating a new Matrix block automatically opens up the first datepicker

Created on 17 Dec 2018  路  2Comments  路  Source: craftcms/cms

Description

This commit (July 17th, 2018) introduced a new behaviour to Matrix, where the first text input receives keyboard focus when a new block is created.

Since Date fields also have the .text classname, this causes the first Date field's datepicker to automatically toggle open when a new block is added, if there aren't any other text inputs preceding the Date field in that block.

This feels like unintended behaviour.

Steps to reproduce

  1. Create a Matrix block type where a Date field is the first (text) field
  2. Add a new block in the Matrix field input

Additional info

  • Craft version: 3.0.35
  • PHP version:
  • Database driver & version:
  • Plugins & versions:
authoring enhancement

Most helpful comment

The problem with auto-focusing the date field in particular, is that the open datepicker tends to overlap other fields, obscuring context. Feels like a bug to me.

In general, I think Craft is making a few assumptions with the auto-focusing behaviour that I'm not convinced it should make, such as

a) the user never needs to survey the complete FLD for context (e.g., without fields being obscured by an open datepicker)
b) the user will always want to start editing content as soon as the block is created
c) the content model is linear and it'll always make sense for the user to start editing the first (top) field first

I do see where autofocusing is useful for certain workflows, I'm just not convinced it makes sense to have this behaviour as a default for everything (and especially not in regards to date fields). In any case, it would be really cool to have some way of tailoring the auto-focus behaviour in the future :)

All 2 comments

Seems like it鈥檚 still expected behavior to me? If that鈥檚 the first field, it鈥檚 probably the first thing that authors will want to enter when creating a new block.

The problem with auto-focusing the date field in particular, is that the open datepicker tends to overlap other fields, obscuring context. Feels like a bug to me.

In general, I think Craft is making a few assumptions with the auto-focusing behaviour that I'm not convinced it should make, such as

a) the user never needs to survey the complete FLD for context (e.g., without fields being obscured by an open datepicker)
b) the user will always want to start editing content as soon as the block is created
c) the content model is linear and it'll always make sense for the user to start editing the first (top) field first

I do see where autofocusing is useful for certain workflows, I'm just not convinced it makes sense to have this behaviour as a default for everything (and especially not in regards to date fields). In any case, it would be really cool to have some way of tailoring the auto-focus behaviour in the future :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitboxfw picture bitboxfw  路  3Comments

angrybrad picture angrybrad  路  3Comments

michel-o picture michel-o  路  3Comments

benface picture benface  路  3Comments

lukebailey picture lukebailey  路  3Comments