diff --git a/packages/components/ui/src/Switch.svelte b/packages/components/ui/src/Toggle.svelte similarity index 87% rename from packages/components/ui/src/Switch.svelte rename to packages/components/ui/src/Toggle.svelte index 137d556b6..b5fb7edf8 100644 --- a/packages/components/ui/src/Switch.svelte +++ b/packages/components/ui/src/Toggle.svelte @@ -5,10 +5,11 @@ const dispatch = createEventDispatcher(); const defaultTheme = { - height: '24px', color: 'black', backgroundColor: 'white', - knobColor: 'lightgrey' + focusOutline: '2px auto black', + height: '24px', + knobColor: 'lightgrey', } // mandatory @@ -32,12 +33,20 @@ currentValue = currentValue === values[0] ? values[1] : values[0]; dispatch('toggled', currentValue); } + const onKeypress = event => { + if (event.keyCode === 13 || event.key === ' ') { + event.preventDefault(); + toggle(); + } + } -