surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.21k stars 813 forks source link

Question type `html` does not render `NextJs Link`, #3791

Open AWIXOR-zz opened 2 years ago

AWIXOR-zz commented 2 years ago

Are you requesting a feature, reporting a bug, or asking a question?

Reporting a bug

What is the current behavior?

I am trying to add a custom button to my survey by doing like this:

{
      type: "html",
      name: "info",
      html: "<Link href='/learn-more'><a class='sv-btn learn-more'>Learn more</a></Link>",
},

I am using the nextjs Link, when the survey is rendered it looks like this:

<div>
   <link href="/learn-more">
   <a class="sv-btn learn-more">Learn more</a>
</div>

The closing tag for link is not there?

What is the expected behavior?

Since the close tag for the link is not there the route doesn't work!

Specify your

andrewtelnov commented 2 years ago

@AWIXOR html is standart html. In html standard "link" tag is absolutely different from Nextjs. It will not work in the way you want it to work.

Thank you, Andrew

AWIXOR-zz commented 2 years ago

@andrewtelnov Is there any other way to make SPA links work in my case?

tsv2013 commented 2 years ago

The html question content supports the plain HTML tags only