-
Notifications
You must be signed in to change notification settings - Fork 60
Description
Describe the bug
A clear and concise description of what the bug is.
// use math to mak sure theres enou space even if buttons are tall
let w = bs.getGoodWidth(300);
let a = 300*200; // a = w * h; h = a/w
let h = Math.min(window.innerHeight * 0.95, a / w)
let result
//copy bellow this line into https://jspanel.de/#extensions/dialog
//tiny width screen i still want to work :)
w = 100
h = 300
result = await jsPanel.dialog.alert(
// param html
'You are about to exit! Continue?',
// param buttons
[
{label: 'Yes!! Dont Ask.', value: 'ALWAYS', css: 'px-1 py-1 bg-secondary btn-sm '},
{label: 'Yes Close', value: 'YES', css: 'px-4 py-2 bg-gray-100 bg-danger'},
{label: 'No Take Me back', value: 'NO', css: 'px-4 py-2 bg-info'},
],
// param options
{
theme: 'bg-secondary filleddark',
border: '1px solid bg-info',
borderRadius: '.5rem',
panelSize: {
width: w,
height: h
},
callback: panel=>{
window.px = panel
console.log(px.options.panelSize)
}
}
);
//later see the var for your self
console.log(px.options.panelSize)
px.options.panelSize
px.resize(px.options.panelSize); // only modifies height
To Reproduce
Copy the code into the browser.
then check the size, or use debug tools to use a responsivly small browser
Expected behavior
A clear and concise description of what you expected to happen.
alert should respect explicit size request, it should also allow small sizes with a large list of buttons (3) and use grid or flex or some fancy css to allow warping of buttons onto multiple lines based on space available.
it might be nice to detect size of window and make default correspondingly good like the equation above.
some work on fix/ workaround
<style>
.jsPanel-dialog {
/*min-width: 400px;*/
max-width: calc(90vw - 50px);
margin-top: 50px;
max-height: calc(90vh - 50px);
}
.buttonbar {
display: flex;
}
</style>
after doing the above and the calling px.resize(px.options.panelSize) it kind of works but im not sure this is the complete solution. needs a little more digging into the css maybe and how dialog works.
Desktop:
- OS: debian stable
- Browser firefox
Anyway lmk what you think


