Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class NightingaleScrollboxItem<TData> extends NightingaleElement {

private setContent(content: string | null | undefined) {
if (content === undefined || content === null) return;
this.innerHTML = DOMPurify.sanitize(content);
this.innerHTML = DOMPurify.sanitize(content, { CUSTOM_ELEMENT_HANDLING: { tagNameCheck: /.*/, attributeNameCheck: /.*/, allowCustomizedBuiltInElements: true } });
}

/** Set or remove "onRegister" callback function. Also run this callback function if the item is already registered (i.e. in "new", "visible", or "hidden" state). */
Expand Down
4 changes: 2 additions & 2 deletions packages/nightingale-scrollbox/src/nightingale-scrollbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export class NightingaleScrollbox<TData> extends NightingaleElement {
unregister: () => this.unregister(item),
};
}
/** Remove a scrollbox item and run "onUnregister" callback on it. This method is called automatically when a `nightingale-scrollbox-item` element is removed from the `nightingale-scrollbox` element. */
/** Remove a scrollbox item and run "onUnregister" callback on it. Do nothing if the item is not registered. This method is called automatically when a `nightingale-scrollbox-item` element is removed from the `nightingale-scrollbox` element. */
unregister(item: NightingaleScrollboxItem<TData>) {
if (!this._items.has(item)) throw new Error(`Cannot unregister item ${item} because it is not registered.`)
if (!this._items.has(item)) return;
this._items.delete(item);
this.observer?.unobserve(item);
item.unregister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { html } from "lit-html";
import { range } from "lodash-es";
import "../../packages/nightingale-navigation/src/index";
import "../../packages/nightingale-scrollbox/src/index";
import { NightingaleScrollbox, NightingaleScrollboxItem } from "../../packages/nightingale-scrollbox/src/index";
import type { NightingaleScrollbox, NightingaleScrollboxItem } from "../../packages/nightingale-scrollbox/src/index";
import "../../packages/nightingale-track/src/index";


export default {
Expand Down