Next.js Discord

Discord Forum

@modal/(.)post - Link without opening a modal window

Unanswered
Anthony Fubon posted this in #help-forum
Open in Discord
Tell me please, I have @modal/(.)post and on the put page there is a button to go to the post. If I click on the link it opens a modal window.

I need to add a separate button to go directly to the post. But any link opens a modal window.

How to make a link without opening a modal window?

10 Replies

Savannah
just to be clear, you want two buttons one that opens a modal and one that opens the page itself?

i.e you do want to enable a modal sometimes
Hello.

Yes. I have one component running right now with modal windows.

I need to make 2 buttons. One opens the modal window, the second one works as a normal link to go to the full post.
Savannah
i think you can do it with a regular anchor tag
this example is a modified version of nextgram
anchor tags wont be intercepted by the router but it will trigger a new request
Thank you. I'll give it a try
Savannah
nw let me know if it works

you could do target="_blank" and retain the user's state on the original page
Unfortunately, it didn't work out
Savannah
weird it does work on my end