bpmn-io / form-js

View and visually edit JSON-based forms.
https://bpmn.io/toolkit/form-js/
Other
413 stars 106 forks source link

Anchor Tags Can Lead to Page Reload #101

Closed philippfromme closed 3 years ago

philippfromme commented 3 years ago

Describe the Bug

Anchor tags with an empty or relative href lead to a page reload.

WXWAQ5Wf4h

Steps to Reproduce

  1. Add <a href>Click</a> or <a href="foo">Click</a> to a text form field
  2. Click link in form
  3. Page reloads

Expected Behavior

Page doesn't reload. One way to avoid this issue would be adding target="_blank" to all anchor tags by default.

Environment

nikku commented 3 years ago

Proposal enforce links opening as target="_blank" rel="noopener" for all but local anchors (#xyz).

andreasgeier commented 3 years ago

I agree that we should open links externally: in a viewer scenario a new browser tab would be opened. In the Modeler editor we would call the standard browser of the system to open the link.

In the viewer, anchor links should not show that behavior but jump to the reference within a page. Editor scenario tbd

philippfromme commented 3 years ago

This issue is fixed in v0.24.0 of form-js. Therefore, I'll close this issue. A follow-up issue regarding the potential enhancement can be found here: https://github.com/bpmn-io/form-js/issues/116.

@andreasgeier Links within the document work as expected.

NJ6hq8jt0m