SJRK-422: Clicking on a newly added block shifts focus to the previously focused block

Metadata

Source
SJRK-422
Type
Bug
Priority
Major
Status
Open
Resolution
N/A
Assignee
N/A
Reporter
Justin Obara
Created
2020-11-12T16:03:38.156-0500
Updated
2020-11-12T16:06:29.133-0500
Versions
N/A
Fixed Versions
N/A
Component
  1. Storytelling Tool UI

Description

Steps to reproduce:

  1. Open the StoryTelling tool and create a new story ( https://staging-stories.floeproject.org/storyEdit.html )
  2. Add a couple of blocks
  3. Focus one of the blocks
  4. Add a new block
  5. Click on the newly added block
  6. Notice that focus moves back to the previously focused block

It is likely this is happening due to the delayed refresh of the reorder able elements (blocks). With the Reorderer when you move focus away from the reorderable elements it tracks what was last focused. When you refocus the group of reorderable elements it pushes focus to what had last been focused. In this case the new block is part of the reorderable container but not one of the reorderable elements yet, which is applied on focus. So the Reorderer tries to move focus to the previously selected reorderable element.