After the dialog is opened, and the page refreshed, the dialog will not close if opened again. It won’t close by clicking the space around the dialog or the buttons on the dialog.
Here I declare the contents of the dialog:
let dialogContent = {
title: 'Default Settings',
form: {
header1: {
type: 'heading',
label: 'Sort courses by: '
},
option: {
type: 'radio',
model: 'opt1',
items: [
{label: 'Course', value: 'opt1'},
{label: 'Section', value: 'opt2'}
]
},
header2: {
type: 'heading',
label: 'Select the default number of rows in tables: '
},
slider: {
type: 'slider',
label: 'Default rows displayed',
min: 5,
max: 15,
step: 5,
withLabel: true,
model: 5,
color: 'primary'
}
},
buttons: [
'Cancel',
{
label: 'Save',
handler (data) {
Toast.create({
html: 'Defaults Updated',
color: 'white',
bgColor: 'grey'
})
}
}
]
}
and here I create the dialog:
const dialog = Dialog.create(
dialogContent
)