Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add empty string as valid _target value, remove target property if value is not set (fix #106) #107

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading