Skip to content

Commit

Permalink
Merge pull request #11 from jmsche/success-content-html
Browse files Browse the repository at this point in the history
Allow to use HTML for success content
  • Loading branch information
guillaumebriday committed May 19, 2023
2 parents f5fc183 + 1dc4586 commit f0af55c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Allow to use HTML for success content.

## [3.3.0] - 2022-12-23

### Added
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
<section class="mt-16">
<div
data-controller="clipboard"
data-clipboard-success-content="Copied!"
data-clipboard-success-content="<strong>Copied!</strong>"
class="mt-1 flex rounded-md shadow-sm"
>
<input
Expand Down Expand Up @@ -172,7 +172,7 @@ <h1 class="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:t
</button>
</div>

<div data-controller="clipboard" data-clipboard-success-content="Copied!" class="relative mt-16">
<div data-controller="clipboard" data-clipboard-success-content="<strong>Copied!</strong>" class="relative mt-16">
<button
class="absolute top-2 right-2 p-2 bg-white hover:bg-gray-200 rounded"
type="button"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class extends Controller {
clearTimeout(this.timeout)
}

this.buttonTarget.innerText = this.data.get('successContent')
this.buttonTarget.innerHTML = this.data.get('successContent')

this.timeout = setTimeout(() => {
this.buttonTarget.innerHTML = this.originalContent
Expand Down

0 comments on commit f0af55c

Please sign in to comment.