Skip to content

Commit e5ebd78

Browse files
committed
Also handle cancel press when handling live change
1 parent e4281e4 commit e5ebd78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/gui/menu.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ class JSRootMenu {
10921092
}
10931093
if (!kind)
10941094
kind = 'text';
1095-
const inp_type = (kind === 'int') ? 'number' : 'text';
1095+
const inp_type = (kind === 'int') ? 'number' : 'text', value0 = value;
10961096
let ranges = '';
10971097
if ((value === undefined) || (value === null))
10981098
value = '';
@@ -1114,8 +1114,11 @@ class JSRootMenu {
11141114

11151115
return new Promise(resolveFunc => {
11161116
this.runModal(title, main_content, { btns: true, height: 150, width: 400, oninit }).then(element => {
1117-
if (!element)
1117+
if (!element) {
1118+
if (onchange)
1119+
onchange(value0);
11181120
return;
1121+
}
11191122
let val = element.querySelector('.jsroot_dlginp').value, isok = true;
11201123
if (kind === 'float') {
11211124
val = Number.parseFloat(val);

0 commit comments

Comments
 (0)