interface RenderProps {
setCopyButton: (node: HTMLElement | null) => void;
copySuccess: boolean;
- role: string;
}
interface Props {
handleSuccessCopy = () => {
if (this.mounted) {
this.setState({ copySuccess: true });
+ if (this.copyButton) {
+ this.copyButton.focus();
+ }
setTimeout(() => {
if (this.mounted) {
this.setState({ copySuccess: false });
render() {
return this.props.children({
setCopyButton: this.setCopyButton,
- copySuccess: this.state.copySuccess,
- role: 'button'
+ copySuccess: this.state.copySuccess
});
}
}