Comments (9)
I'll investigate it further and try to find the source of the issue. I'll keep you updated.
from handsontable.
Hi @ottosson
Thank you for reporting this. Can you please share more details about your implementation? Do you only hide the tables visually without destroying and re-initializing the instance?
from handsontable.
Yes exactly.
I keep all of the tables in the DOM and never destroy them, just hide/unhide them when needed.
Not sure what else to add. I'll see if I can scale back the application to a minimal reproduction of the issue at some point.
from handsontable.
That would be great, as I tried a few scenarios and can't reproduce the issue properly.
from handsontable.
I couldn't let this go so here is a minimal reproduction:
https://stackblitz.com/edit/vitejs-vite-wvxyw3?file=src%2FApp.tsx
I'm sure the approach is a bit unorthodox. Let me know if it can be improved.
from handsontable.
Thank you for the example. I've reviewed it, but so far, I can't find the source for this issue. It's hard to replicate with a React wrapper, but with some trickery, I was able to make it work with hide/show management without the error. Here's an example as a point of reference that, in general, it should work: https://jsfiddle.net/handsoncode/Lcwnzoa8/.
In your case, without the React wrapper, it's more complicated. This might be due to state handling, but it needs more investigation. Also, I noticed that you are destroying the instance and not only visually hiding/showing the table.
from handsontable.
Thanks. I checked your example and it creates multiple instances of the table when clicking hide/show a couple of times.
Also, I noticed that you are destroying the instance and not only visually hiding/showing the table
Yes that seems like something I might have done to handle the double render in strict mode.
from handsontable.
It was a long time since I wrote the original implementation and it's not how I would have approached it today. So I switched to using a boolean useRef to check if the component has been initialized and return early if that's the case. Now I don't have to destroy the table on component unmount.
It solves my issue but the underlying bug is still there I guess.
from handsontable.
Hi @ottosson
After further investigation I'm still not able to find the exact source, but it seems that it's somehow connected to destroying and rebuilding the instance.
If we just use state to manage the table's visibility the problem isn't present: https://stackblitz.com/edit/vitejs-vite-wwhgef?file=src%2FApp.jsx&terminal=dev Maybe that would be a better approach to this requirement until we find the reason for this issue.
In this example we used our React wrapper, but the solution is universal and should also work with your approach.
from handsontable.
Related Issues (20)
- `columnSummary` does not include formulated cells HOT 1
- [Bug]: vue dev-tools, Select a component HOT 2
- Unnecessary reactivity on the hotInstance when using with Vue 2. HOT 5
- Issue with paste data with smart quotes and new line \n HOT 1
- Handsontable does not respond in Adobe Illustrator HOT 1
- Uncaught TypeError: Cannot read properties of null (reading 'getSheetDimensions') HOT 4
- Table inside iframe does not trigger change when typing and then clicking outside the iframe on in another iframe HOT 3
- At the same web page,copy handsontable then cannot copy anything HOT 7
- [Bug]: At the same page,copy handsontable then cannot copy anything HOT 1
- Handsontable 14.4.0 is here!
- npm error Cannot read properties of null (reading 'matches') HOT 2
- Cell value missing HOT 1
- [Bug]: Display bug in iphone HOT 2
- After adding a border, insert a line above the border without moving it down HOT 1
- CopyPaste plugin paste(...) function doesn't work when outsideClickDeselects setting is set to false HOT 1
- Search function is including less results then before HOT 3
- npm run build error,when version from 14.0.0 to 14.4.0 HOT 5
- Remove `-ms-high-constrast` in CSS as it is being deprecated!! HOT 2
- Closed as duplicate of: https://github.com/handsontable/handsontable/issues/11016 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from handsontable.