我在反应中使用 Chakra UI,当我尝试单击可点击框中的按钮时,正在执行框的功能。Z-index 也没有解决这个问题。
我的代码:
<Box
w="90%"
h="auto"
mt="10px"
position="relative"
key={index}
borderWidth="1px"
borderRadius="lg"
onClick={() =>
history.push(`/products/${item.cat_name}/${item.id}`)}
>
<h1 className={styles.heading_bold}>{item.cat_name}</h1>
<Button position="absolute" top="3" right="3" zIndex="0"> //Button not able to click
Options
</Button
</Box>