Skip to content

[Link] Disabled link still able to click when there is a onClick handler #693

@amandac628

Description

@amandac628

Prerequisites

Describe the issue

When there is a onClick handler passed in the slot, the function will still be triggered:

<sgds-link disabled>
     <a href='#' onClick={handleClick}>Link</a>
</sgds-link>

Solution: we could try to use the CSS pointer-events: none on disabled to prevent any events from bubbling down to the slots.

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

Describe your frontend stack. What version of React and @govtechsg/sgds-web-component are you using? CSR or SSR?

react-19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions