Skip to content

Commit 5fcf964

Browse files
authored
fix(test): immediately reposition caret and tape on tapeMargin change (@byseif21) (monkeytypegame#6860)
### Description changing `tapeMargin` mid-test didn’t move the caret until typing resumed because no layout update was triggered for this config.
1 parent a376446 commit 5fcf964

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

frontend/__tests__/root/config-metadata.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ describe("ConfigMeta", () => {
5555
.sort();
5656

5757
expect(configsWithTriggeResize).toEqual(
58-
["fontSize", "keymapSize", "maxLineWidth", "tapeMode"].sort()
58+
[
59+
"fontSize",
60+
"keymapSize",
61+
"maxLineWidth",
62+
"tapeMode",
63+
"tapeMargin",
64+
].sort()
5965
);
6066
});
6167
describe("overrideValue", () => {

frontend/src/ts/config-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ export const configMetadata: ConfigMetadataObject = {
512512
tapeMargin: {
513513
icon: "fa-tape",
514514
displayString: "tape margin",
515+
triggerResize: true,
515516
changeRequiresRestart: false,
516517
},
517518
smoothLineScroll: {

0 commit comments

Comments
 (0)