Skip to content

Conversation

@jvbianchi
Copy link
Contributor

@jvbianchi jvbianchi commented Apr 26, 2025

πŸ”— Linked issue

Resolves #3974
Resolves #3990

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This is a attempt to fix the issue in #3974.
This is my first contribution to open-source, let me know if something is wrong.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 26, 2025

npm i https://pkg.pr.new/@nuxt/ui@3989

commit: 64e9c30

@benjamincanac
Copy link
Member

benjamincanac commented Apr 30, 2025

Why not keep the same v-if / v-else structure? πŸ€” This makes it difficult to review.

@jvbianchi
Copy link
Contributor Author

Because the InertiaLink must only be used when the url is defined.

I think that, the issue arises because the InertiaLink component is rendered even when the url is null. In such cases, it attempts to navigate, potentially leading to unexpected behavior like linking to the current page or triggering navigation events.

Copy link
Member

@romhml romhml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jvbianchi πŸ˜„

@benjamincanac benjamincanac changed the title fix(inertia): always rendering a anchor tag fix(inertia): link always render as anchor tag May 4, 2025
@benjamincanac benjamincanac merged commit e81464a into nuxt:v3 May 4, 2025
6 checks passed
@jvbianchi jvbianchi deleted the patch-1 branch May 4, 2025 15:41
@Mallon94
Copy link

Mallon94 commented May 7, 2025

@benjamincanac does this PR address the onSelect InertiaLink issue? I changed the Link.vue file for testing and still onSelect within a dropdown menu does not trigger

Copy link
Member

Did you use the latest pkg.pr.new package? This hasn't been released yet.

@benjamincanac benjamincanac added the v3 #1289 label May 7, 2025
@Mallon94
Copy link

Mallon94 commented May 7, 2025

Did you use the latest pkg.pr.new package? This hasn't been released yet.

Yes, i have the newest pkg.pr.new. The onSelect issue seems to persist.

Copy link
Member

It does indeed, @romhml any idea about this?

@FabianMHz15
Copy link

@benjamincanac I want to think @Mallon94 is using nuxt/ui-pro because in nuxt/ui https://pkg.pr.new/@nuxt/ui@999a0f8 it is already fixed

joaopms added a commit to joaopms/laravel-vue-showcase that referenced this pull request May 8, 2025
Buttons are treated as links, breaking forms.

Fixed in nuxt/ui#3989, but un-released as of
now.
@Mallon94
Copy link

Mallon94 commented May 8, 2025

@FabianMHz15 I am using nuxt/ui-pro however it directly depends on nuxt/ui so I am able to override which version it uses and I've tested out these newer patches and the issue still persists.

Copy link
Member

Yes I've reproduced the issue as well using @nuxt/ui-pro and with a @nuxt/ui resolution to the latest pkg.pr.new.

@fusigabs
Copy link

fusigabs commented May 8, 2025

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 #1289

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header toogle menu not working in an Intertia app (useRoute still being used) Inertia: onSelect in dropdown items stop working

7 participants