Skip to content

Conversation

oliverfoster
Copy link
Member

@oliverfoster oliverfoster commented Jun 26, 2025

fixes #676

Allowed a11y.setPopupCloseTo to work with the notify. Added the popup:closing event, followed immediately by an await wait.queue() to allow other plugins to calculate and assign an element to a11y.setPopupCloseTo($element).

This works principally because the notify does not need to retain the document.activeElement when opening, as the popup API already performs this function at the following lines:

this._addPopupLayer($popupElement);

this._focusStack.push($(document.activeElement));

const $previousFocusElement = this._removeLastPopupLayer();

return this._focusStack.pop();

this.a11y.focusFirst($($focusElement), { preventScroll: true });

Fix

  • Removed code from notify to return to the previous active element and rely on the popup API to handle it

New

  • Added popup:closing event with an await wait.queue such that other plugins can listen to the event and wait.begin(), a11y.setPopupCloseTo($element) and wait.end()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor

@joe-allen-89 joe-allen-89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently throwing an error, missing import for wait

@oliverfoster
Copy link
Member Author

thanks @joe-allen-89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Cannot change focal element on notify close

3 participants