Date: Wed, 28 Oct 2020 13:31:20 -0400
Subject: [PATCH 4/6] Apply suggestions from code review
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
---
CHANGELOG.md | 3 ++-
src-docs/src/views/link/link.js | 2 +-
src/components/link/link.tsx | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc096b0960d..fe7211c818f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)
- Added more exports for `EuiInMemoryTable` types ([#4179](https://github.com/elastic/eui/pull/4179))
-- Added screen reader notification for `EuiLink` when it opens in a new tab ([#3659](https://github.com/elastic/eui/pull/3659))
+- Added screen reader notification if `EuiLink` opens in a new window ([#4172](https://github.com/elastic/eui/pull/4172))
+- Set `external` prop to true if `EuiLink` opens in a new window ([#4172](https://github.com/elastic/eui/pull/4172))
**Bug fixes**
diff --git a/src-docs/src/views/link/link.js b/src-docs/src/views/link/link.js
index e0eeaef7bbd..fb4f6929292 100644
--- a/src-docs/src/views/link/link.js
+++ b/src-docs/src/views/link/link.js
@@ -10,7 +10,7 @@ export default () => (
Elastic website
{' '}
in a new tab. Setting target=“_blank” also
- defaults to external={true}.
+ defaults to {`external={true}`}.
This{' '}
diff --git a/src/components/link/link.tsx b/src/components/link/link.tsx
index f6136683859..dcc1ceedc4a 100644
--- a/src/components/link/link.tsx
+++ b/src/components/link/link.tsx
@@ -69,8 +69,8 @@ export interface LinkAnchorProps {
type?: EuiLinkType;
color?: EuiLinkColor;
/**
- * Set to true to show an icon indicating that it is an external link. Defaults to true if
- * `target="_blank".
+ * Set to true to show an icon indicating that it is an external link;
+ * Defaults to true if `target="_blank"`
*/
external?: boolean;
}
From 10e598fd84891bfcca73891762ffe4cbd936d9a5 Mon Sep 17 00:00:00 2001
From: Michail Yasonik
Date: Wed, 28 Oct 2020 15:29:01 -0400
Subject: [PATCH 5/6] Apply suggestions from code review
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
---
src-docs/src/views/link/link.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src-docs/src/views/link/link.js b/src-docs/src/views/link/link.js
index fb4f6929292..c26bcee972a 100644
--- a/src-docs/src/views/link/link.js
+++ b/src-docs/src/views/link/link.js
@@ -14,10 +14,10 @@ export default () => (
This{' '}
-
+
link
{' '}
- has the external prop set to false.
+ has the external prop set to true.
This link is actually a {}}>button with
From ebcae5ae706d53c220245d0e38f5047e2c83b941 Mon Sep 17 00:00:00 2001
From: Michail Yasonik
Date: Wed, 28 Oct 2020 15:34:12 -0400
Subject: [PATCH 6/6] PR feedback on i18n
---
src-docs/src/views/link/link.js | 2 +-
src/components/link/link.tsx | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src-docs/src/views/link/link.js b/src-docs/src/views/link/link.js
index c26bcee972a..9a053101769 100644
--- a/src-docs/src/views/link/link.js
+++ b/src-docs/src/views/link/link.js
@@ -10,7 +10,7 @@ export default () => (
Elastic website
{' '}
in a new tab. Setting target=“_blank” also
- defaults to {`external={true}`}.
+ defaults to {'external={true}'}.
This{' '}
diff --git a/src/components/link/link.tsx b/src/components/link/link.tsx
index dcc1ceedc4a..c1147511cd7 100644
--- a/src/components/link/link.tsx
+++ b/src/components/link/link.tsx
@@ -25,7 +25,7 @@ import React, {
} from 'react';
import classNames from 'classnames';
import { EuiIcon } from '../icon';
-import { useEuiI18n } from '../i18n';
+import { EuiI18n, useEuiI18n } from '../i18n';
import { CommonProps, ExclusiveUnion, keysOf } from '../common';
import { getSecureRelForTarget } from '../../services';
import { EuiScreenReaderOnly } from '../accessibility';
@@ -116,10 +116,10 @@ const EuiLink = forwardRef(
const newTargetScreenreaderText = (
- {useEuiI18n(
- 'euiLink.newTarget.screenReaderOnlyText',
- '(opens in a new tab or window)'
- )}
+
);