Skip to content

Commit

Permalink
updated for rel
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 committed Mar 1, 2020
1 parent 9db62df commit b3fe9eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- `EuiButton` now has a single return statement ([#2896](https://github.com/elastic/eui/pull/2896))
- `EuiButton` now has a single return statement ([#2954](https://github.com/elastic/eui/pull/2954))
- Converted `EuiForm` to TypeScript, added many missing `/form` Prop types ([#2896](https://github.com/elastic/eui/pull/2896))
- Empty table th elements replaced with td in `EuiTable`. ([#2934](https://github.com/elastic/eui/pull/2934))
- Added default prompt text to `aria-describedby` for `EuiFilePicker` ([#2919](https://github.com/elastic/eui/pull/2919))
Expand Down
6 changes: 4 additions & 2 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ export const EuiButton: FunctionComponent<Props> = ({
// <Element> elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
// this is a button and piggyback off its disabled styles.
const Element = href && !isDisabled ? 'a' : 'button';
const relObj: { rel?: string } = {};
if (href && !isDisabled)
relObj.rel = getSecureRelForTarget({ href, target, rel });

const secureRel = getSecureRelForTarget({ href, target, rel });
let buttonType: ButtonHTMLAttributes<HTMLButtonElement>['type'];

return (
Expand All @@ -177,7 +179,7 @@ export const EuiButton: FunctionComponent<Props> = ({
disabled={isDisabled}
href={href}
target={target}
rel={secureRel}
{...relObj}
ref={buttonRef as Ref<HTMLButtonElement & HTMLAnchorElement>}
type={type as typeof buttonType}
{...rest as HTMLAttributes<HTMLAnchorElement | HTMLButtonElement>}>
Expand Down

0 comments on commit b3fe9eb

Please sign in to comment.