Skip to content

Commit

Permalink
Merge pull request #331 from stefanprobst/feat/htmlelement-option
Browse files Browse the repository at this point in the history
feat: allow directly passing `HTMLElement` to default pagefind ui `options.element`
  • Loading branch information
bglw authored Jun 26, 2023
2 parents 188a50d + 56633a0 commit 9104639
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pagefind_ui/default/ui-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class PagefindUI {
delete opts["mergeIndex"];
delete opts["translations"];

const dom = document.querySelector(selector);
const dom = selector instanceof HTMLElement ? selector : document.querySelector(selector);
if (dom) {
this._pfs = new PagefindSvelte({
target: dom,
Expand Down

0 comments on commit 9104639

Please sign in to comment.