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

Commit b223a0a

Browse files
committed
fix: passthrough attr type on iconbutoton
1 parent 800f0be commit b223a0a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/c-button/src/button.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import {
1414
ComponentWithProps,
1515
DeepPartial,
1616
} from "@chakra-ui/vue-system"
17-
import {
18-
ThemingProps,
19-
SystemStyleObject
20-
} from "@chakra-ui/styled-system"
17+
import { ThemingProps, SystemStyleObject } from "@chakra-ui/styled-system"
2118
import { dataAttr, filterUndefined, mergeWith } from "@chakra-ui/utils"
2219
import { useButtonGroup } from "./button-group"
2320
import { CIcon, IconProps } from "@chakra-ui/c-icon"
@@ -110,7 +107,7 @@ const CButtonIcon = defineComponent({
110107
},
111108
})
112109

113-
export interface CButtonProps extends HTMLChakraProps<"button"> { }
110+
export interface CButtonProps extends HTMLChakraProps<"button"> {}
114111

115112
/**
116113
* CButton
@@ -205,7 +202,8 @@ export const CButton = defineComponent({
205202
{...((props.value.isDisabled || props.value.isLoading) && {
206203
disabled: props.value.isDisabled || props.value.isLoading,
207204
})}
208-
type={props.value.as === "button" ? undefined : props.value.type}
205+
type={props.value.type}
206+
data-type={dataAttr(props.value.type)}
209207
data-active={dataAttr(props.value.isActive)}
210208
data-loading={dataAttr(props.value.isLoading)}
211209
__css={buttonStyles.value}

0 commit comments

Comments
 (0)