Skip to content

Ensure backdrop remains to fadeout after apply is clicked#6971

Open
duncanuszkay-d2l wants to merge 1 commit into
mainfrom
dunk.backdrop-fade-out-fix
Open

Ensure backdrop remains to fadeout after apply is clicked#6971
duncanuszkay-d2l wants to merge 1 commit into
mainfrom
dunk.backdrop-fade-out-fix

Conversation

@duncanuszkay-d2l
Copy link
Copy Markdown
Contributor

@duncanuszkay-d2l duncanuszkay-d2l commented May 12, 2026

https://desire2learn.atlassian.net/browse/NTNGL-5471?atlOrigin=eyJpIjoiMWYyNDEzMjUyMWIzNDRjYmJkYWQ2NTg1N2QxYmUyNjAiLCJwIjoiaiJ9

While working on adding the dirty overlay to the list component, I noticed that recent accessibility changes were preventing the backdrop from fading out.

I'll point out what went wrong with inline comments.

This PR resolves the issue, as seen in this before/after:

Before

Recording.2026-05-12.112502.mp4

After

Recording.2026-05-12.112341.mp4

@github-actions
Copy link
Copy Markdown
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-6971/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

@duncanuszkay-d2l duncanuszkay-d2l force-pushed the dunk.backdrop-fade-out-fix branch from 4285065 to 865fc0a Compare May 12, 2026 15:26
Comment on lines +174 to 176
<div aria-live="polite" class="${classMap({ 'd2l-offscreen': true })}" style="${styleMap(forcedOffscreenSizelessStyles)}">
${this._ariaContent}
</div>
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This had to be moved into its own offscreen box so that announcement content wouldn't appear on the screen while the backdrop is fading out.

</div>`
}
<div aria-live="polite" class="${classMap({ 'd2l-offscreen': !dirtyStateVisible })}" style="${styleMap(dirtyStateVisible ? {} : forcedOffscreenSizelessStyles)}">
${this.dataState === 'dirty' ? this.#renderDirtyOverlay() : this._ariaContent}
Copy link
Copy Markdown
Contributor Author

@duncanuszkay-d2l duncanuszkay-d2l May 12, 2026

Choose a reason for hiding this comment

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

This would prevent the dirty state box from rendering the moment that the data state switched over to loading, preventing the fade-in animation from occuring.

Instead, I'm rendering this component whenever the backdrop is visible, even if that just results in it remaining inert offscreen.

@duncanuszkay-d2l duncanuszkay-d2l force-pushed the dunk.backdrop-fade-out-fix branch from 865fc0a to 38e47e7 Compare May 12, 2026 15:41
let hideImmediately = reduceMotion || this._state === 'showing';
if (this._state === 'shown') {
const currentOpacity = getComputedStyle(this.shadowRoot.querySelector('.backdrop')).opacity;
const currentOpacity = getComputedStyle(this.shadowRoot.querySelector('d2l-backdrop-dirty-overlay')).opacity;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This selector was outdated 👀

style=${styleMap({ top: `${this._dirtyDialogTop}px` })}
description="${this.dirtyText}"
action="${this.dirtyButtonText}"
?inert=${this.dataState !== 'dirty'}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While the backdrop is fading out to the loading state, we want to make sure the button within the dirty overlay is inaccessible, so I'm making this section inert when we're not in the dirty state.

Comment on lines -299 to -305
#renderDirtyOverlay() {
return html`<d2l-backdrop-dirty-overlay
style=${styleMap({ top: `${this._dirtyDialogTop}px` })}
description="${this.dirtyText}"
action="${this.dirtyButtonText}"
></d2l-backdrop-dirty-overlay>`;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I inlined this, I felt it was easier to read that way.

@duncanuszkay-d2l duncanuszkay-d2l force-pushed the dunk.backdrop-fade-out-fix branch from 38e47e7 to 3adcc93 Compare May 14, 2026 15:13
@duncanuszkay-d2l duncanuszkay-d2l marked this pull request as ready for review May 14, 2026 15:39
@duncanuszkay-d2l duncanuszkay-d2l requested a review from a team as a code owner May 14, 2026 15:39
@duncanuszkay-d2l duncanuszkay-d2l requested a review from GZolla May 14, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant