From a84a336df65f9e392d1ffcc1df41a4f418a8f446 Mon Sep 17 00:00:00 2001 From: Ye Date: Fri, 24 May 2024 08:55:56 -0700 Subject: [PATCH] fix shadowRoot for CalendarWidget To fix an issue where calendar widget's masked date caret position is wrong on shadowDOM CalendarWidget extends Element and uses setInputMask. setInputMask needs shadowRoot for text-mask to work properly. formio/formio.js#3693 previous fixed the text-mask for other inputs, but the fix does not appear to work for the CalendarWidget because it does not have a (WebForm) root. Relates to https://github.com/text-mask/text-mask/pull/1034/files --- src/Element.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Element.js b/src/Element.js index adb84edbcb..db18a94611 100644 --- a/src/Element.js +++ b/src/Element.js @@ -406,7 +406,7 @@ export default class Element { inputElement: input, mask, placeholderChar: this.placeholderChar, - shadowRoot: this.root ? this.root.shadowRoot : null + shadowRoot: this.root?.shadowRoot || this?.options.shadowRoot || null }); } catch (e) {