JI-6152 Stop focussing edit image button on content load

Description

Acceptance criteria

  • When in the H5P editor and opening a content, when there’s an “image” field rendered off screen, the corresponding “Edit image” button does not get focus and thus does not cause the view to jump down.

  • When in the H5P editor and uploading an image to an image in an “image” field, the “Edit image” button gets focus.

Background

In JI-6152 the “Edit image” button was given focus inside the addFile method. However, the addFile method does not only get called when an author actively uploads an image, but also when the author opens previously saved content. As a consequence, giving focus to the edit button may cause the editor view to jump downwards when opening content for editing.

Suggestion

Pull request at

Environment

None

Acceptance Criteria

None

Activity

Gwen Tripet-Costet May 31, 2024 at 12:32 PM

Simen Bergo May 28, 2024 at 1:07 PM

Reviewed together with , changes look good! The issue is ready for testing.

Done

Details

Assignee

Reporter

Code reviewer

Sprint

Tester

Priority

Created May 27, 2024 at 1:03 PM
Updated August 6, 2024 at 12:11 PM
Resolved May 31, 2024 at 12:32 PM