Skip to content

Commit

Permalink
fix(clipboard): target element can be input element too
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanszogyenyi committed Feb 14, 2024
1 parent 5cd600a commit e4f9f16
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion content/components/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ import type { InstanceOptions } from 'flowbite';
const $triggerEl: HTMLElement = document.getElementById('copy-clipboard-button') as HTMLElement;

// set the target element where the text will be copied from (ie. input field, code block)
const $targetEl: HTMLElement = document.getElementById('copy-text') as HTMLElement;
const $targetEl: HTMLInputElement = document.getElementById('copy-text') as HTMLInputElement;

// optional options with default values and callback functions
const options: CopyClipboardOptions = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/clipboard/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CopyClipboardOptions } from './types';

export declare interface CopyClipboardInterface {
_triggerEl: HTMLElement | null;
_targetEl: HTMLElement | null;
_targetEl: HTMLElement | HTMLInputElement | null;
_options: CopyClipboardOptions;

init(): void;
Expand Down

0 comments on commit e4f9f16

Please sign in to comment.