Skip to content

Commit 1872675

Browse files
committed
refactor(CCloseButton): don't emit click event when button is disabled
1 parent fd5e873 commit 1872675

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/coreui-vue/src/components/close-button/CCloseButton.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const CCloseButton = defineComponent({
1818
required: false,
1919
},
2020
},
21-
2221
emits: [
2322
/**
2423
* Event called when the user clicks on the component.
@@ -27,6 +26,10 @@ export const CCloseButton = defineComponent({
2726
],
2827
setup(props, { emit }) {
2928
const handleClick = () => {
29+
if (props.disabled) {
30+
return
31+
}
32+
3033
emit('click')
3134
}
3235
return () =>

0 commit comments

Comments
 (0)