@bobfrankston/msger 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
|
|
163
163
|
document.addEventListener('keydown', function(e) {
|
|
164
164
|
if (e.key === 'Escape') {
|
|
165
|
-
const result = { button: '
|
|
165
|
+
const result = { button: 'Cancel', dismissed: true };
|
|
166
166
|
window.ipc.postMessage(JSON.stringify(result));
|
|
167
167
|
} else if (e.key === 'Enter') {
|
|
168
168
|
const buttons = document.querySelectorAll('button');
|
package/msgernative-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { showMessageBox } from '../index.js';
|
|
3
|
+
|
|
4
|
+
console.log('Testing Escape key behavior...');
|
|
5
|
+
console.log('A dialog will appear. Press Escape to dismiss it.');
|
|
6
|
+
console.log('It should return button: "Cancel" with dismissed: true\n');
|
|
7
|
+
|
|
8
|
+
const result = await showMessageBox({
|
|
9
|
+
title: 'Press Escape to Test',
|
|
10
|
+
message: 'Press the Escape key to dismiss this dialog',
|
|
11
|
+
buttons: ['Yes', 'No', 'OK']
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
console.log('Result:', result);
|
|
15
|
+
|
|
16
|
+
if (result.button === 'Cancel' && result.dismissed === true) {
|
|
17
|
+
console.log('✅ TEST PASSED: Escape returns Cancel');
|
|
18
|
+
} else {
|
|
19
|
+
console.log('❌ TEST FAILED: Expected button="Cancel" and dismissed=true');
|
|
20
|
+
}
|