Problem/Motivation

When we close (close or submit inner form) a modal dialog, the last focused element is moved into view which may be completely random (sometimes the first element in the parent form or the last element edited for example). That's not intended and the focused element should really be the button that opened the modal, we don't want any scrolling when it closes as it only confuses end users and they always have to scroll back.

Steps to reproduce

Open a course add/edit form, set focus on any field, open a modal (lesson parameters for example), close the modal. Observe the window jumps to the last focused field even if it was completely out of the viewport.

Proposed resolution

Focus on the trigger button before opening the modal.

Remaining tasks

This is really a core issue, when a modal dialog is opened, its opener is set to the last focused element instead of the actual opener. Find / create a core issue that addresses that and track.

Issue fork lms-3579438

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

graber created an issue. See original summary.

graber’s picture

Status: Active » Needs review
graber’s picture

Issue summary: View changes

  • graber committed 61f945bf on 1.1.x
    Resolve #3579438 "Fix scrolling issues"
    
graber’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.