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

QColor is rising an error when it's inside a QMenu and you double click on it #10028

Closed
kevingermain opened this issue Jul 10, 2021 · 6 comments
Labels

Comments

@kevingermain
Copy link

If QColor is inside a QMenu and the user double click (by mistake for example) QColor rise an error Uncaught TypeError: Cannot read property 'clientWidth' of null and it's closing the menu even it's not the desired behavior.

Can be simply tested here: https://quasar.dev/vue-components/color-picker#with-qinput
Open the console first, try to double click, and see the error and the QMenu closing unexpectedly.

(it works if the screen is small enough (mobile mode for example))

Screenshot at 18-11-17

@hawkeye64
Copy link
Member

@kevingermain I am not seeing any issues here.
image

Can you try in incognito mode?

@kevingermain
Copy link
Author

@hawkeye64 I tried with all disabled extensions, with brave (without the shield) and another chrome from another computer, still the issue (the issue is not showing with firefox).

Try to double click a lot on the same spot.

@MilosPaunovic
Copy link
Member

After 10 minutes od relentles clicking, I've managed to reproduce the issue:

  • Open color picker
  • Click on any color and hold down the mouse button
  • Swipe around selecting colors (don't let mouseup event occur)
  • Quickly double click outside of picker

Repro video link.

It raise error in console:
Screenshot 2021-07-15 at 14 14 09

@hawkeye64
Copy link
Member

I am still unable to reproduce it. But, I have an idea what is happening. The mouse event queue is getting backed up and by the time you click outside, the panel has been destroyed, but mouse events are still coming in and being processed.

    function changeSpectrum (left, top, change) {
      const panel = spectrumRef.value
      if (panel === void 0) { return }

      const
        width = panel.clientWidth, // < -- here
        height = panel.clientHeight,
        rect = panel.getBoundingClientRect()

rstoenescu pushed a commit that referenced this issue Jul 19, 2021
…10028 (#10096)

* fix(QColor): Making sure panel exists before mouse event is processed #10028

* Checking if panel is null in changeSpectrum function
@rstoenescu
Copy link
Member

Fix will be available in Quasar v2.0.3

@kevingermain
Copy link
Author

The error disappear in the console but the problem still here. Can someone confirm please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants