fix: prevent infinite update loop by conditionally sending updates in WrapperField #963

This commit is contained in:
Elio Struyf
2026-06-23 11:06:48 +02:00
parent de1bcbbe53
commit 7cb3eb14f5
2 changed files with 7 additions and 1 deletions
+1
View File
@@ -13,6 +13,7 @@
### 🐞 Fixes
- Fix number fields not being saved to front matter when used inside block field groups
- [#963](https://github.com/estruyf/vscode-front-matter/issues/963): Prevent infinite update loops for fields when using Hugo partials as values in the front matter
- [#1041](https://github.com/estruyf/vscode-front-matter/issues/1041): Fix in image page when using page bundles
## [10.10.1] - 2026-04-23
@@ -128,7 +128,12 @@ export const WrapperField: React.FunctionComponent<IWrapperFieldProps> = ({
}).then((data) => {
if (data.field === field.name) {
setFieldValue(data.value);
onSendUpdate(field.name, data.value, parentFields);
// Only write back if the placeholder was actually resolved to something different,
// otherwise values like Hugo shortcodes ({{%...%}}) that contain {{ }} but are
// not FM placeholders would cause an infinite update loop.
if (data.value !== value) {
onSendUpdate(field.name, data.value, parentFields);
}
}
}).catch((err) => {
console.error(err);