Toolbar buttons sometimes missing on first load

Hello,

We are customising the Plumsail toolbar and are experiencing an intermittent issue with it.

On the first load of the form page, the Plumsail toolbar sometimes does not render / disappears after we customise it with JavaScript (remove default buttons and add custom ones). If we refresh the browser, the toolbar and custom button(s) appear as expected.

We are expecting the toolbar to consistently appear on initial load with our custom buttons.

**Code:
**
//add new buttons
var curPlateCheckBtn = {
icon: 'WaitlistConfirm',
class: 'btn-outline-primary btn-disable-click',
text: 'Mark Sample as Batch Checked',
location: 0,
click: function() {
markSamplesAsBatchChecked('Batch');
}
}
var allPlatesCheckBtn = {
icon: 'WaitlistConfirm',
class: 'btn-outline-primary',
text: 'Mark Sample as All Plates Check',
location: 0,
click: function() {
markSamplesAsBatchChecked('All Plates');
}
}

function applyToolbar() {
    if (!fd.toolbar || !fd.toolbar.buttons) return false;

    var value = fd.field('Choice1').value || 'Current Plate';
    fd.toolbar.buttons = (value === 'Current Plate')
        ? \[curPlateCheckBtn\]
        : \[allPlatesCheckBtn\];

    return true;
}

// Set default choice before applying
fd.field('Choice1').value = fd.field('Choice1').value || 'Current Plate';
applyToolbar();


// Update on change
fd.field('Choice1').$on('change', function() {
    applyToolbar();
});

Thank you

Georgios

Hi @george,

Could you send a screenshot of the browser's console (F12) and a HAR log of the issue to support@plumsail.com?