Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add disabled attribute handling to link #2101

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

D4ve-R
Copy link
Contributor

@D4ve-R D4ve-R commented Nov 22, 2024

This PR adds handling of the disabled attribute to links.

Problem:

Currently clicking on Links where the disabled attribute is set, triggers a request.

<!-- unexpected request on click -->
<Link href="#" disabled>Disabled</Link>

Solution:

Add a disabled prop to the Link Component and stop click & prefetch events, when attribute exists or is set to true

Notes:

The changes are currently only implemented in @interia/vue.
If accepted, I will implement it in @interia/react & @interia/svelte too.

@D4ve-R
Copy link
Contributor Author

D4ve-R commented Nov 22, 2024

fixes #1620

<Link :disabled="disabled">
<!-- instead of -->
<Link :as="disabled ? 'button' : 'a'" :disabled="disabled">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant