fix(frontend): Fix multi select custom css (#1813)

* fix(frontend): Fix multi select custom css

* fix(frontend): Fix wording
This commit is contained in:
Faton Ramadani
2023-07-08 13:40:27 +02:00
committed by GitHub
parent e35079189a
commit 518bf23005
2 changed files with 16 additions and 8 deletions
@@ -341,7 +341,9 @@
script.language = Script.language.BUN
}}
>
<LanguageIcon lang="bun" /><span class="ml-2 py-2">Typescript (Bun, experimental)</span>
<LanguageIcon lang={Script.language.BUN} /><span class="ml-2 py-2">
Typescript (Bun, experimental)
</span>
</Button>
<!-- <Button
@@ -66,7 +66,17 @@
$: css = concatCustomCss($app.css?.multiselectcomponent, customCss)
$: outerDiv && css?.multiselect?.style && outerDiv.setAttribute('style', css?.multiselect?.style)
function setOuterDivStyle(outerDiv: HTMLDivElement, portalRef: HTMLDivElement, style: string) {
outerDiv.setAttribute('style', style)
// find ul in portalRef and set style
const ul = portalRef.querySelector('ul')
ul?.setAttribute('style', style)
}
$: outerDiv &&
portalRef &&
css?.multiselect?.style &&
setOuterDivStyle(outerDiv, portalRef, css?.multiselect?.style)
let outerDiv: HTMLDivElement | undefined = undefined
let portalRef: HTMLDivElement | undefined = undefined
@@ -131,17 +141,13 @@
open = false
}}
>
<div slot="option" let:option class="hover:bg-gray-200 p-1 cursor-pointer z-50">
<div slot="option" let:option>
{option}
</div>
</MultiSelect>
<Portal>
<div use:floatingContent class="z5000" hidden={!open}>
<div
bind:this={portalRef}
class="bg-white w-full border shadow-md rounded-md"
style={`min-width: ${w}px; `}
/>
<div bind:this={portalRef} class="multiselect" style={`min-width: ${w}px;`} />
</div>
</Portal>
</div>