mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 23:37:27 +00:00
Fix usability of hyperlinks
This commit is contained in:
@@ -56,7 +56,9 @@ export default class Block extends React.Component<BlockProps, BlockState> {
|
|||||||
if (event.nativeEvent.target.nodeName !== "INPUT" && !contains) {
|
if (event.nativeEvent.target.nodeName !== "INPUT" && !contains) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
if (event.nativeEvent.target.nodeName !== "A") {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ type DocProps = {
|
|||||||
'sdk-support'?: {
|
'sdk-support'?: {
|
||||||
[key: string]: typeof headers
|
[key: string]: typeof headers
|
||||||
}
|
}
|
||||||
docUrl?: string
|
docUrl?: string,
|
||||||
|
docUrlDescription?: string
|
||||||
}
|
}
|
||||||
}; // & WithTranslation?
|
}; // & WithTranslation?
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ export default class Doc extends React.Component<DocProps> {
|
|||||||
render () {
|
render () {
|
||||||
const {fieldSpec} = this.props;
|
const {fieldSpec} = this.props;
|
||||||
|
|
||||||
const {doc, values, docUrl} = fieldSpec;
|
const {doc, values, docUrl, docUrlDescription} = fieldSpec;
|
||||||
const sdkSupport = fieldSpec['sdk-support'];
|
const sdkSupport = fieldSpec['sdk-support'];
|
||||||
|
|
||||||
const renderValues = (
|
const renderValues = (
|
||||||
@@ -86,9 +87,9 @@ export default class Doc extends React.Component<DocProps> {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{docUrl &&
|
{docUrl && docUrlDescription &&
|
||||||
<div className="SpecDoc__learn-more">
|
<div className="SpecDoc__learn-more">
|
||||||
<a href={docUrl} target="_blank" rel="noreferrer" onClick={() => console.log('Link clicked')}>Learn More (TODO i18n)</a>
|
<a href={docUrl} target="_blank" rel="noreferrer" onClick={() => console.log('Link clicked')}>{docUrlDescription}</a>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user