Skip to content

Commit

Permalink
Fix: Add empty string as valid _target value, remove target property …
Browse files Browse the repository at this point in the history
…if value is not set (fixes #107)
  • Loading branch information
swashbuck authored Sep 2, 2024
1 parent b826b7e commit 4500361
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@
"_target": {
"type": "string",
"required": false,
"enum": ["_blank", "_self", "_parent", "_top"],
"enum": ["", "_blank", "_self", "_parent", "_top"],
"default": "_blank",
"title": "Target attribute",
"inputType": {
"type": "Select",
"options": ["_blank", "_self", "_parent", "_top"]
"options": ["", "_blank", "_self", "_parent", "_top"]
},
"validators": [],
"help": "This targets where to open the link. Acceptable values are '_blank' (opens the linked document in a new window or tab), '_parent' (opens the linked document in the parent frame), '_top' (opens the linked document in the full body of the window) or '_self' (opens the linked document in the same frame as it was selected. If no value is set, the default is '_blank'."
Expand Down
1 change: 1 addition & 0 deletions schema/component.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"title": "Target attribute",
"description": "This targets where to open the link. Acceptable values are '_blank' (opens the linked document in a new window or tab), '_parent' (opens the linked document in the parent frame), '_top' (opens the linked document in the full body of the window) or '_self' (opens the linked document in the same frame as it was selected. If no value is set, the default is '_blank'.",
"enum": [
"",
"_blank",
"_self",
"_parent",
Expand Down
2 changes: 1 addition & 1 deletion templates/graphic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function Graphic(props) {

<LinkWrapper
href = {_graphic._url}
target = {_graphic._target}
target = {_graphic._target || null}
className = 'graphic__link js-graphic-link'
role = 'link'
>
Expand Down

0 comments on commit 4500361

Please sign in to comment.