Avoid double-counting prompt editor height
This commit is contained in:
@@ -262,9 +262,6 @@ function configure(node) {
|
|||||||
// Measure the actual DOM panel instead of guessing from slot count.
|
// Measure the actual DOM panel instead of guessing from slot count.
|
||||||
const panelHeight = Math.ceil(panel.getBoundingClientRect().height || panel.scrollHeight || 0);
|
const panelHeight = Math.ceil(panel.getBoundingClientRect().height || panel.scrollHeight || 0);
|
||||||
display.computeSize = (width) => [Math.max(420, Number(width) || 420), panelHeight + 2];
|
display.computeSize = (width) => [Math.max(420, Number(width) || 420), panelHeight + 2];
|
||||||
const fittedWidth = Math.max(420, Number(node.size?.[0]) || 420);
|
|
||||||
const fittedHeight = Number(node.computeSize?.()[1]) || panelHeight + 180;
|
|
||||||
node.setSize?.([fittedWidth, fittedHeight]);
|
|
||||||
};
|
};
|
||||||
const refresh = () => { state = readState(stateWidget, Number(countWidget.value) || 2, Number(secondsWidget.value) || 4); render(); setState(); };
|
const refresh = () => { state = readState(stateWidget, Number(countWidget.value) || 2, Number(secondsWidget.value) || 4); render(); setState(); };
|
||||||
countWidget.callback = ((previous) => function(...args) { const result = previous?.apply(this, args); refresh(); return result; })(countWidget.callback);
|
countWidget.callback = ((previous) => function(...args) { const result = previous?.apply(this, args); refresh(); return result; })(countWidget.callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user