We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5302176 commit e2b9efaCopy full SHA for e2b9efa
packages/uui-form-validation-message/lib/uui-form-validation-message.element.ts
@@ -27,12 +27,14 @@ export class UUIFormValidationMessageElement extends LitElement {
27
return this._for;
28
}
29
public set for(value: HTMLElement | string | null) {
30
- let queriedElement = null;
+ let element = null;
31
if (typeof value === 'string') {
32
const scope = this.getRootNode();
33
- queriedElement = (scope as DocumentFragment)?.getElementById(value);
+ element = (scope as DocumentFragment)?.getElementById(value);
34
+ } else if (value instanceof HTMLElement) {
35
+ element = value;
36
- const newScope = queriedElement || this;
37
+ const newScope = element ?? this;
38
const oldScope = this._for;
39
40
if (oldScope === newScope) {
0 commit comments