__Issue description__:
When destroying then re-instantiating a slider on viewport resizing (with different options) i.e. within a window.watchMedia listener: an exception is thrown and the slider is not destroyed successfully:
TypeError: null is not an object (evaluating 'n.parentNode.firstElementChild')
(anonymous function) β tiny-slider.js:1551
forEach
destroy β tiny-slider.js:1545
initialiseSlider β index.html:75
j β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:1:3941
get β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:2:26712
css β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:2:26408
(anonymous function) β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:3:18213
access β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:2:5963
(anonymous function) β everypage-0e95adae4bb69d30b4cb02bf3e2b442d3bfbc0ebb7e5cb2983d7a2ab7cc9bb52.js:3:17982
M β index-91133e28b0e3348db53bd3f3086f8328b5dabc10f96e2a76a7b0c5e584f15751.js:5:32198
P β index-91133e28b0e3348db53bd3f3086f8328b5dabc10f96e2a76a7b0c5e584f15751.js:5:31419
C β index-91133e28b0e3348db53bd3f3086f8328b5dabc10f96e2a76a7b0c5e584f15751.js:5:31085
emitEvent β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:16688
dragMove β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:24379
_dragMove β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:24314
pointerMove β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:23477
_pointerMove β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:20518
onmousemove β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:20228
handleEvent β commonLibs-361493429bb9f80462ff7ccdbe48cb444552cda5f0655ec0f127e7fbf0d5444d.js:3:18878
2tiny-slider.js:1550
__Demo link/slider setting__:
https://codepen.io/darrencadwallader/pen/MBdQgz
_Tiny-slider version_: 2.8.5
_Browser name && version_: Safari 11.1.2, Chrome 68.0.3440.106
_OS name && version_: macOS 10.13.6 (17G65)
Fixed in this commit.
Thanks so much, this fix works for me! I look forward to the next release :)
@ganlanyuan do you have any idea when this is going to be released ? :-) As this is a major issue on our project at the moment, to see if i find a work around or if this is going to be released any time soon ?
Thanks a lot,
@ganlanyuan Please, update npm package. Thank you in advance!
@Suruat if itβs super-urgent, you could change the entry in your package.json to:
"tiny-slider": "git+https://github.com/ganlanyuan/tiny-slider#55a846549e07ce1129420296d598454db8e5a147"
β¦though youβll need to remember to change it back to the normal version later.
Published in v2.8.6
Most helpful comment
Fixed in this commit.