revolist / revogrid

Powerful virtual data grid smartsheet with advanced customization. Best features from excel plus incredible performance 🔋
https://revolist.github.io/revogrid
MIT License
2.68k stars 167 forks source link

TypeError: Cannot read properties of undefined (reading 'focused' / 'clearAutoFillSelection') #403

Closed os-tohe closed 11 months ago

os-tohe commented 1 year ago

Description In Vue3, when I move to the page using router where the VGrid component is and hover over it, it starts throwing error messages. When I hover over it it throws this error:

index.js:3204 TypeError: Cannot read properties of undefined (reading 'focused')
at proxyCustomElement.readonly.onMouseMove (revogr-overlay-selection2.js:476:18)
at HTMLDocument.<anonymous> (index.js:3007:35) undefined

If I click anywhere on screen it throws this error:

index.js:3204 TypeError: Cannot read properties of null (reading 'clearAutoFillSelection')
at proxyCustomElement.readonly.onMouseOut (revogr-overlay-selection2.js:482:16)
at HTMLDocument.<anonymous> (index.js:3007:35) undefined

The error persists until I refresh the page. If I just move to other page, it still throws the error whenever I move the mouse. The problem does not occur if the VGrid is on the initial page, for example if I move to the page by changing the url.

Console log RevoGrid error

os-tohe commented 1 year ago

I was able to work around this issue by adding v-if="show" to VGrid, setting it to false by default and enabling it after 1 millisecond:

setTimeout(() => {
  show.value = true
}, 1)
m2a2x commented 11 months ago

Hello, is there a way you could provide https://codesandbox.io/s/revo-grid-vue3-thry7 example with this problem? It seems element is missing on the init stage.

Thank you!

os-tohe commented 11 months ago

I am unable to reproduce the error now. I have drastically modified my code, so probably something I did has fixed it.

revolist commented 11 months ago

I am unable to reproduce the error now. I have drastically modified my code, so probably something I did has fixed it.

Thanks for the prompt response. We have made attempts to resolve the issue using all available methods, including deleting references to the actual element itself. It appears that the problem lies on the Ionic side, as we encountered similar issues with one of our customers' implementations. Upon investigation, we found that the grid component was extensively modified by an external wrapper, causing RevoGrid to re-render during the initial run and resulting in the loss of reference. However, we noticed that when we moved the grid higher in the DOM tree, everything returned to normal.