mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-11 16:34:57 +03:00
fix(web-test): fillTableRow stops Tab early when only checkboxes remain
Tab past the last cell in 1C creates extra rows. Now when all unfilled fields are checkboxes (boolean values), the Tab loop exits immediately instead of pressing Tab 3 more times on non-INPUT cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2537,7 +2537,10 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
|
||||
if (cell.tag !== 'INPUT' || !cell.fullName) {
|
||||
// Not in an editable grid cell — Tab past (ERP has DIV focus between cells)
|
||||
nonInputCount++;
|
||||
if (nonInputCount > 3) break; // truly exited edit mode
|
||||
// If only checkbox fields remain unfilled, stop Tab'ing to avoid creating extra rows
|
||||
const onlyCheckboxLeft = [...pending.values()].every(p => p.filled ||
|
||||
['true', 'false', 'да', 'нет', '1', '0', 'yes', 'no'].includes(p.value.toLowerCase().trim()));
|
||||
if (nonInputCount > 3 || onlyCheckboxLeft) break;
|
||||
await page.keyboard.press('Tab');
|
||||
await page.waitForTimeout(300);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user