From da4916e3c119a3a551b6d5ff7c92c076a4a87b92 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Fri, 11 Jun 2021 13:24:38 +0200 Subject: [PATCH] XFA - Center vertically radio without caption - and fix intent value which is used to name the radio button group. --- src/core/xfa/template.js | 2 ++ src/display/xfa_layer.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/xfa/template.js b/src/core/xfa/template.js index 3755e8c67..ef8fa4ab8 100644 --- a/src/core/xfa/template.js +++ b/src/core/xfa/template.js @@ -2391,6 +2391,8 @@ class Field extends XFAObject { const caption = this.caption ? this.caption[$toHTML]().html : null; if (!caption) { + // Even if no caption this class will help to center the ui. + ui.attributes.class.push("xfaLeft"); return HTMLResult.success(createWrapper(this, html), bbox); } diff --git a/src/display/xfa_layer.js b/src/display/xfa_layer.js index 7f2ba8650..9717eb74e 100644 --- a/src/display/xfa_layer.js +++ b/src/display/xfa_layer.js @@ -125,7 +125,7 @@ class XfaLayer { static render(parameters) { const storage = parameters.annotationStorage; const root = parameters.xfa; - const intent = parameters.intent; + const intent = parameters.intent || "display"; const rootHtml = document.createElement(root.name); if (root.attributes) { this.setAttributes(rootHtml, root);