Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockUI breaks when its mask is styled with an infinite animation #7302

Open
1 of 4 tasks
SupImDos opened this issue Feb 23, 2025 · 0 comments
Open
1 of 4 tasks

BlockUI breaks when its mask is styled with an infinite animation #7302

SupImDos opened this issue Feb 23, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@SupImDos
Copy link

SupImDos commented Feb 23, 2025

Describe the bug

Styling a <BlockUI> component's mask with an infinite animation stops it from ever unblocking. This appears to be because the component waits for the "animationend" event before calling removeMask():

if (hasCSSAnimation(this.mask) > 0) {
this.mask.addEventListener('animationend', () => {
this.removeMask();
});
} else {

It would be nice to be able to style the mask with an infinite animation such as animate-pulse without it breaking the component.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

Unsure if this is valid, and if so what the approach should be to fix it.
Maybe the approach should involve a hasInfiniteCSSAnimation utility that does:

return getComputedStyle(element).getPropertyValue('animation-iteration-count') === 'infinite'

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-njjbnlqt?file=src%2FApp.vue

Environment

StackBlitz

Vue version

3.4.31

PrimeVue version

4.2.5

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Click the "Block" button
  2. Click the "Unblock" button
  3. Observe that the mask is never removed, "unblock" is never emitted, and continuing to click the "Block" button again adds more masks to the DOM

Expected behavior

The mask is removed and "unblock" is emitted

@SupImDos SupImDos added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant