Skip to content

Commit 1f1ee86

Browse files
Luke BowermanLuke Bowerman
authored andcommitted
Only use BTOA library if window is not available
1 parent 4dc2cbe commit 1f1ee86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/components/src/Form/Inputs/Combobox/ComboboxInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ export const indicatorSize = '1rem'
208208
export const indicatorPadding = '.5rem'
209209
export const comboboxPaddingRight = `calc(2 * ${indicatorPadding} + ${indicatorSize})`
210210

211+
const base64 = typeof window !== 'undefined' ? window.btoa : btoa
211212
const indicatorPrefix = 'data:image/svg+xml;base64,'
212213
export const selectIndicatorBG = (color: string) =>
213-
`url('${indicatorPrefix}${btoa(
214+
`url('${indicatorPrefix}${base64(
214215
indicatorRaw.replace('currentColor', color)
215216
)}')`
216217

0 commit comments

Comments
 (0)