umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.41k stars 2.66k forks source link

First field in a non-inline Block List Item grabs focus when closing a nested dialogue #16057

Closed jdpnielsen closed 4 months ago

jdpnielsen commented 5 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.2.2

Bug summary

When closing a nested dialogue in a non-inline block list item, the first field of the block list item takes focus, leading to a bad editor experience when editing block list items with many fields.

Specifics

Video:

https://github.com/umbraco/Umbraco-CMS/assets/8746698/1c4797a1-c2c4-405b-8e8a-3ad5fc1ee4fc

I have observed this with both block list and media picker property editors

Steps to reproduce

  1. Create clean umbraco v13 project
  2. Import schema export-65e3719d-ce2d-4f11-86e7-cc186a9972e8.zip
  3. Click block item
  4. Scroll to media field
  5. Open and close media modal

Expected result / actual result

I would expect the opened property editor field to be in focus - or that the scroll position was respected

github-actions[bot] commented 5 months ago

Hi there @jdpnielsen!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

nul800sebastiaan commented 4 months ago

Fixed in https://github.com/umbraco/Umbraco-CMS/pull/16116

jdpnielsen commented 4 months ago

@nul800sebastiaan There seems to still be an error with Block lists.

https://github.com/umbraco/Umbraco-CMS/assets/8746698/9864235f-ed1e-45d0-9a40-abc9109f5284

Weirdly enough, it works when triggering the block list item via keyboard navigation:

https://github.com/umbraco/Umbraco-CMS/assets/8746698/11d0c910-d34b-484e-a0a4-cfe4856d8234

It seems to me that something about the logic for adding items on click to $rootScope.lastKnownFocusableElements is broken.