Skip to content

Commit

Permalink
fix(lib): context picker state
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 13, 2024
1 parent 56a7b5e commit 54ef036
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/elements/rh-context-picker/rh-context-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ export class RhContextPicker extends LitElement {
this.sync();
} else if (this.target) {
const root = this.getRootNode() as Document | ShadowRoot;
this.#target = root.getElementById(this.target);
this.sync();
if (root instanceof Document || root instanceof ShadowRoot) {
this.#target = root.getElementById(this.target);
this.sync();
}
} else {
this.#target = this.closest('rh-surface');
}
Expand Down

0 comments on commit 54ef036

Please sign in to comment.