jeanverster / chakra-ui-steps

Steps component designed to work seamlessly with Chakra UI
https://chakra-ui-steps.vercel.app
390 stars 44 forks source link

Clicking anywhere inside the step contents triggers onClickStep #95

Closed projectsbydan closed 2 years ago

projectsbydan commented 2 years ago

When using the onClickStep prop, the user can no longer interact with the contents without triggering the function.

For example, clicking on prev/next Buttons that are inside the step, triggers the onClickStep and prevents navigation.

Ideally, this would only be triggered when clicking on the step label or icon.

Is there any way to trigger navigation when clicking on the label? The styling seems to be perfect for this, as the label turns into a link.

projectsbydan commented 2 years ago

I managed to trick it by adding a container for the contents of the step, with an onClick={(e) => e.stopPropagation()} prop on it.