Issue with Responsive Extension in DataTables 2.2.0
Issue with Responsive Extension in DataTables 2.2.0
Link to test case: https://live.datatables.net/moqoqolo/1/edit
Description of problem: I recently updated DataTables from version 2.1.8 to 2.2.0 along with the Responsive extension and noticed an issue. Columns don’t automatically hide when resizing the window, as expected with the Responsive extension. However, if I reload the page after resizing the window, the columns adjust correctly.
I’ve also tested the examples provided in the documentation under the Responsive section, and the same issue occurs: the columns don’t hide properly when resizing the window unless the page is reloaded.
Could this be a bug in version 2.2.0, or is there something I need to adjust in my configuration?
Thank you for your help!
This question has accepted answers - jump to:
Answers
Yes, it very much looks like it I'm afraid. Sorry about that. I'll get on the case about that tomorrow.
Allan
@allan The problem seems to come from the new ResizeObserver part. This is the same issue I reported yesterday.
Below you can see the demo, which works as expected after uncommenting the
if condition
part in the source code:https://live.datatables.net/moqoqolo/2/edit?html,js,output
Hi,
Replying here rather than the other thread since you are both here .
I've been working on this today and I think I'm getting somewhere. It appears that
ResizeObserver
triggers as soon as you observe an element, which I had not been expecting, and I don't see clearly documented anywhere, but it does appear to be consistent behaviour. I'm going to dig more into that - I've only just realised this after chasing errors in the unit tests.Allan
I should have left the office, but couldn't with this going on in my head after most of a day working on it!
I've committed a fix which will shortly be in the nightly. The unit tests are passing for the core and the CI will check the extensions. Hopefully I'll be able to make a release tomorrow.
Allan