I use fullpage.js to create some sort of Full-Screen-Matrix, in my node/Electron App so the user can scroll with the Keyboard up/down, left/right to always have one fullscreen data record. This works great as long as I don't start adding or deleting slides (the data is kept somewhere else and is updated live).
The code I got so far is:
let masterRactive = new Ractive({
el: '#clientContainer',
template: myTemplate,
magic: true,
modifyArrays: true,
data: {docs},
computed: //some magic here,
onrender: function () {
$('#container').fullpage({
navigation: true,
showActiveTooltip: true,
slidesNavigation: true,
recordHistory: false,
fixedElements: 'h1',
paddingTop: '80px'
});
$.fn.fullpage.setAllowScrolling(false, 'down,up');
}
});
And to recalculate on Change events I use
masterRactive.observe( 'docs', function ( newValue, oldValue, keypath ) {
$.fn.fullpage.reBuild()
})
Everything works great until I add or delete a Slide. The Data is shown/hidden correctly, and scrolling up and down works as well, but when trying to scroll sideways I always get Uncaught TypeError: Cannot read property 'left' of undefined
.
I also tried $.fn.fullpage.destroy('all');
and reinitiallizing on every change, but the effect is the same...
Update:
As I found out, this behaviour only occurs if the deleted slide is the one shown. If I delete slides or Sections which are not active everything seems to work. (even though the Slide Navigation does not Change e.G. from 3 to 2 Slides if one is deleted)