Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fix(Button): propagate listeners to button
Browse files Browse the repository at this point in the history
  • Loading branch information
tewshi authored and kelsos committed Oct 19, 2023
1 parent bffad08 commit 186d7c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions example/src/components/AppNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@rotki/ui-library-compat';
const css = useCssModule();
const { switchThemeScheme } = useRotkiTheme();
const { switchThemeScheme, store } = useRotkiTheme();
interface Theme {
name: string;
Expand Down Expand Up @@ -40,10 +40,11 @@ const onSwitchTheme = ({ value }: Theme) => switchThemeScheme(value);
class="relative flex basis-0 justify-end gap-6 sm:gap-8 md:flex-grow"
>
<span class="sr-only">Theme</span>
<RuiButtonGroup variant="outlined">
<RuiButtonGroup :value="store" variant="outlined">
<RuiButton
v-for="theme in themes"
:key="theme.value"
:value="theme.value"
@click="onSwitchTheme(theme)"
>
<RuiIcon :name="theme.icon" :size="16" />
Expand Down
9 changes: 6 additions & 3 deletions src/components/buttons/button/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ const spinnerSize: ComputedRef<number> = computed(() => {
return 22;
});
const onClick = (event: PointerEvent) => {
emit('click', event);
const onClick = () => {
emit('input', get(value));
};
Expand All @@ -99,7 +98,11 @@ const slots = useSlots();
]"
:disabled="disabled || loading"
v-bind="attrs"
@click="onClick($event)"
v-on="
// eslint-disable-next-line vue/no-deprecated-dollar-listeners-api
$listeners
"
@click="onClick()"
>
<slot v-if="slots.prepend" name="prepend" />
<span v-if="slots.default" :class="css.label"> <slot /> </span>
Expand Down

0 comments on commit 186d7c7

Please sign in to comment.