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

JavaScript error when using ui.notify #3454

Closed
falkoschindler opened this issue Aug 7, 2024 · 3 comments · Fixed by #3457
Closed

JavaScript error when using ui.notify #3454

falkoschindler opened this issue Aug 7, 2024 · 3 comments · Fixed by #3457
Labels
bug Something isn't working
Milestone

Comments

@falkoschindler
Copy link
Contributor

Description

A simple example like

ui.button('Notify', on_click=lambda: ui.notify('Hi!'))

causes a JavaScript error when pressing the button twice or when resizing the window while a notification is visible:

quasar.umd.prod.js:6 Notify: trying to update a grouped one which is forbidden {message: 'Hi!', position: 'bottom', closeBtn: 'OK', multiLine: false, onDismiss: ƒ}

What is happening? 🤔

@falkoschindler falkoschindler added the bug Something isn't working label Aug 7, 2024
@falkoschindler
Copy link
Contributor Author

falkoschindler commented Aug 7, 2024

Bisection shows that this bug has been introduced by PR #3121.
I'll try to further narrow it down, since this PR is quite a monster.

@falkoschindler
Copy link
Contributor Author

@falkoschindler
Copy link
Contributor Author

This if condition in notification.js might do the trick:

  updated() {
    if (this.convertedOptions.group === False) this.notification();
  },

But I noticed that if you try to dismiss a grouped notification (indicated by a red badge in its top left corner), there are UI elements remaining in memory:

ui.button('Notify', on_click=lambda: ui.notify('Hi!', close_button='Close'))
ui.timer(1, lambda: print(len(ui.context.client.elements)))

This might be a separate bug, but seems to be caused by the same commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant