فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
test(q01): exercise hidden-first field focus and restore in installed Windows WebView2
davoodmehraban89 committed
Oct 31, 2026 at 00:11 UTC
94a3fadea3806b1a23e32b57fb7ac2a863b1baa1
1 file changed
+13
-1
tests/windows-vm-ui-interaction-audit-browser.js
+13
-1
@@ -305,8 +305,20 @@
305
if (syntheticConfirmed!==1 || FINORA.Modal.stack.length) {
306
throw Error('Text-only confirmation Cancel executed a callback or leaked a dialog');
307
}
308
+ // A financial editor can start with an invisible radio or hidden ID field.
309
+ // Initial focus must land on the first VISIBLE input, not a hidden element.
310
+ FINORA.Modal.open({title:'Q01 visible-input focus regression',
311
+ body:'<input id="q01HiddenInput" style="display:none"><input id="q01VisibleInput">'});
312
+ await wait(25);
313
+ if (document.activeElement?.id !== 'q01VisibleInput') {
314
+ throw Error('Dialog initial focus landed outside first visible financial input');
315
+ }
316
+ FINORA.Modal.close();
317
+ if (document.activeElement!==modalTrigger) {
318
+ throw Error('Closing visible-input dialog did not restore keyboard focus');
319
+ }
320
const modalKeyboard={roleAndLabel:true,nestedDialogIsolation:true,
309
- confirmationTextEscaped:true,
321
+ confirmationTextEscaped:true,visibleInputAutoFocused:true,
322
escapeClosesWithoutConfirm:true,focusReturnsToTrigger:true,
323
enterOnFocusedCancelDoesNotSave:true,enterOnInputDoesNotSubmit:true,
324
tabAndShiftTabStayInsideTopDialog:true,