From 621aa4362bd1bf995e84d069e1b59b6dff1b2745 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 18 Aug 2023 09:17:02 -0600 Subject: [PATCH] Add HTMLElement to the getTag() return type --- docs/pages/components/select.md | 3 ++- src/components/select/select.component.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/pages/components/select.md b/docs/pages/components/select.md index 5f7791eb..87256381 100644 --- a/docs/pages/components/select.md +++ b/docs/pages/components/select.md @@ -458,7 +458,8 @@ const App = () => ( ### Custom Tags When multiple options can be selected, you can provide custom tags by passing a function to the `getTag` property. -Your `getTag(option, index)` function can return a string or a Lit Template +Your `getTag(option, index)` function can return a string, a Lit Template, +or an HTMLElement. ```html:preview diff --git a/src/components/select/select.component.ts b/src/components/select/select.component.ts index 6aa4d36f..9bc5a0cd 100644 --- a/src/components/select/select.component.ts +++ b/src/components/select/select.component.ts @@ -178,7 +178,7 @@ export default class SlSelect extends ShoelaceElement implements ShoelaceFormCon * is the current tag's index. The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at * the specified value. */ - @property() getTag: (option: SlOption, index: number) => TemplateResult | string = option => { + @property() getTag: (option: SlOption, index: number) => TemplateResult | string | HTMLElement = option => { return html`