diff --git a/src/admin/components/elements/Button/index.tsx b/src/admin/components/elements/Button/index.tsx
index 2552aa342..4ddfc5faa 100644
--- a/src/admin/components/elements/Button/index.tsx
+++ b/src/admin/components/elements/Button/index.tsx
@@ -25,7 +25,9 @@ const ButtonContents = ({ children, icon, tooltip }) => {
const BuiltInIcon = icons[icon];
return (
-
+
{tooltip && (
{tooltip}
@@ -49,6 +51,7 @@ const ButtonContents = ({ children, icon, tooltip }) => {
const Button: React.FC = (props) => {
const {
className,
+ id,
type = 'button',
el,
to,
@@ -86,6 +89,7 @@ const Button: React.FC = (props) => {
}
const buttonProps = {
+ id,
type,
className: classes,
disabled,
diff --git a/src/admin/components/elements/Button/types.ts b/src/admin/components/elements/Button/types.ts
index 3512c5c84..2cdadc7e7 100644
--- a/src/admin/components/elements/Button/types.ts
+++ b/src/admin/components/elements/Button/types.ts
@@ -2,6 +2,7 @@ import React, { MouseEvent } from 'react';
export type Props = {
className?: string,
+ id?: string,
type?: 'submit' | 'button',
el?: 'link' | 'anchor' | undefined,
to?: string,
@@ -12,6 +13,7 @@ export type Props = {
icon?: React.ReactNode | ['chevron' | 'x' | 'plus' | 'edit'],
iconStyle?: 'with-border' | 'without-border' | 'none',
buttonStyle?: 'primary' | 'secondary' | 'transparent' | 'error' | 'none' | 'icon-label',
+ buttonId?: string,
round?: boolean,
size?: 'small' | 'medium',
iconPosition?: 'left' | 'right',
diff --git a/src/admin/components/elements/DeleteDocument/index.tsx b/src/admin/components/elements/DeleteDocument/index.tsx
index 1f32cca29..f9873eb9c 100644
--- a/src/admin/components/elements/DeleteDocument/index.tsx
+++ b/src/admin/components/elements/DeleteDocument/index.tsx
@@ -18,6 +18,7 @@ const DeleteDocument: React.FC = (props) => {
const {
title: titleFromProps,
id,
+ buttonId,
collection: {
admin: {
useAsTitle,
@@ -78,6 +79,7 @@ const DeleteDocument: React.FC = (props) => {
diff --git a/src/admin/components/elements/DeleteDocument/types.ts b/src/admin/components/elements/DeleteDocument/types.ts
index 5c353a5d2..40266d3c6 100644
--- a/src/admin/components/elements/DeleteDocument/types.ts
+++ b/src/admin/components/elements/DeleteDocument/types.ts
@@ -3,5 +3,6 @@ import { SanitizedCollectionConfig } from '../../../../collections/config/types'
export type Props = {
collection?: SanitizedCollectionConfig,
id?: string,
+ buttonId?: string,
title?: string,
}
diff --git a/src/admin/components/elements/DuplicateDocument/index.tsx b/src/admin/components/elements/DuplicateDocument/index.tsx
index be3755d47..5c59984e2 100644
--- a/src/admin/components/elements/DuplicateDocument/index.tsx
+++ b/src/admin/components/elements/DuplicateDocument/index.tsx
@@ -27,6 +27,7 @@ const Duplicate: React.FC = ({ slug }) => {
return (