Skip to content

alert and prompt notification scroll to bottom #662

@danielghost

Description

@danielghost

If the notify content overflows, as focus gets applied to the buttons for alert and prompt types, the content opens already scrolled due to the position of the buttons.

This can be resolved by forcing the scroll back to the top in onLoaded:

async onLoaded() {
this.hasOpened = true;
// Allows popup manager to control focus
a11y.popupOpened(this.$('.notify__popup'));
a11y.scrollDisable('body');
$('html').addClass('notify');
this.$el.addClass('anim-show-before');
// Set focus to first accessible element
a11y.focusFirst(this.$('.notify__popup'), { defer: false });
await transitionNextFrame();
this.resetNotifySize();
await transitionNextFrame();
this.$el.addClass('anim-show-after');
await transitionsEnded(this.$('.notify__popup, .notify__shadow'));
}

const $dialog = this.$('.notify__popup');
$dialog.scrollTop(0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions