[✨] Qwik-city Link preventdefault:click #278
Replies: 5 comments
-
|
What's the use case for this? |
Beta Was this translation helpful? Give feedback.
-
|
Structure of the app:
On top of all features its provides I need it for 2 uses cases
|
Beta Was this translation helpful? Give feedback.
-
A like button on a card which is wrapped by Link tags - clicks to the Like button propagate through to the Link |
Beta Was this translation helpful? Give feedback.
-
|
We moved this issue to |
Beta Was this translation helpful? Give feedback.
-
|
Actually, Link already handles preventdefault:click, either when you specify it yourself, or when the link is a navpath. The issue here is actually that aforementioned button is inside the link and that should get the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
Hello,
The preventdefault:click on <Link href="/qwik"> is ignored.
Describe the solution you'd like
Take into account preventdefault:click when using <Link /> component and do not trigger navigation when its present.
https://github.com/BuilderIO/qwik/blob/275e1c7723a0cf95d8e910514a8047a217bb137f/packages/qwik-city/runtime/src/link-component.tsx#L25
Describe alternatives you've considered
None
Additional context
Thank you
Beta Was this translation helpful? Give feedback.
All reactions